Appearance
MongoDB Atlas
Back up a MongoDB Atlas cluster from SimpleBackups with an SRV connection string, an IP access list entry, and a read-only database user.
MongoDB Atlas is MongoDB's managed database. SimpleBackups reaches it over the network and dumps it with mongodump, the same way it backs up any other MongoDB host. Atlas refuses that connection until the project's IP access list includes SimpleBackups and the connection string uses a user that can read the data. This page is that setup. Scheduling, storage, and retention are the same as any other MongoDB backup.
Use the SRV connection string
Atlas publishes the cluster as a DNS seed list. The connection string starts with mongodb+srv://. A mongodb:// string with one host and port does not match that address, so the connection fails.
- In Atlas, open the cluster and click Connect.
- Choose Drivers.
- Copy the connection string. It looks like this:
plain
mongodb+srv://backup_user:password@cluster0.example.mongodb.net/myDatabase?retryWrites=true&w=majority- Replace
passwordwith the database user's password. Put the database you want to back up before the?. Leave the database name out when the user should back up every database it can read. - In SimpleBackups, create a MongoDB backup, open the Connection String tab, and paste the string.
Allow SimpleBackups in Network Access
Atlas drops connections from addresses that are not on the project access list. Add the SimpleBackups IP addresses before you validate the backup.
- In Atlas, open Network Access.
- Click Add IP Address.
- Add each address from the SimpleBackups list. Add the IPv6 addresses as well when the cluster accepts them.
The backup form shows the same list under Behind a firewall? when the backup runs on SimpleBackups.
Create a read-only backup user
Create a user that exists only for backups. Do not reuse an Atlas admin account.
- In Atlas, open Database Access.
- Click Add New Database User.
- Choose Password and set a password.
- Under Database User Privileges, add one built-in role on
admin:backup, the rolemongodumpis built for.readAnyDatabase, when the backup only needs to read your own databases.
Atlas rejects db.createUser(). Create the user on the Database Access page, then put that user and password in the connection string.