Your opinion helps us make a better documentation.
Was this page helpful?
Back up and restore MongoDB® Databases with MongoDB® tools
Managed MongoDB® provides fully-managed document Database Instances, with a MongoDB®-compatible API layer over a PostgreSQL engine to store and retrieve data.
This means you can use MongoDB® command line tools to use and manage your MongoDB® Databases.
This tutorial shows how to backup and restore your MongoDB® Databases with the MongoDB® mongodump and mongorestore command line database tools.
This tutorial shows you basic restore and backup operations. If you need additional options for the operations, refer to the official MongoDB® documentation.
Make sure you keep the --ssl and --sslCAFile=<file.pem> options in your commands, as you will need to authenticate using the default SSL certificate when you connect to your Database Instance.
To create backups, we will use the mongodump tool, which can create backups for an entire Database Instance, logical database or collection. It can also use a query to back up part of a collection.
Click MongoDB® Databases under Databases on the side menu. A list of your Database Instances displays.
Click the database name or «See more Icon» > More info to access the Database Instance information page.
Download the Database Instance’s SSL certificate.
Important
Make sure you know the path to the certificate on your local machine, as it will be used in a later step.
Run the following command, replacing the values according to the table below.
mongodump \
--host=<ip-address> \
--port=<port> \
--username=<username> \
--password="<password>" \
--out=/path/to/backup \
--ssl \
--sslCAFile=<file.pem> \
--authenticationMechanism=PLAIN
host
the IP address of your Database Instance
port
the connection port of your Database Instance
username
the username of the database user created upon Database Instance creation
password
the password of the database user created upon Database Instance creation
out
the path to the folder where you want the backups to be stored on your machine
sslCAFile
the path to where your SSL certificate is stored
authenticationMechanism
the list of authentication mechanisms the server accepts
If no response is returned, the operation was successful. You can make sure the backup occurred by checking that new files were added to the destination folder.