Welcome, Guest Login

Public Cloud Center

Mongodump & Mongorestore (exporting & restoring)

Last Updated: Mar 04, 2016 08:06AM EST

Backups are not provided or stored by Modulus.  Customers are responsible for performing regular mongodumps/exports of their databases and having those backups in a secured location.

Dump and Restore

If you'd like to import a large amount of data into your database, please contact us for assistance.

mongodump and mongorestore can run locally and connect to your mongo instances.


$ mongodump -h proximus.modulusmongo.net -u user -p pass
  --authenticationDatabase dbId --db dbId

In your terminal you will type the following if dumping db from Modulus: 

$ mongodump -h hostURL.com:port -u user -p pass
--authenticationDatabase dbId --db dbId

The command would look like this for exporting from Modulus:

$ mongodump -h apollo.modulusmongo.net -u root -p root 
--authenticationDatabase Es8ezygy --db Es8ezygy 

The output will look like this (when exporting from Modulus):

The command would look like this for exporting from Compose:
$ mongodump -h alex.mongohq.com:10096 -u root -p root 
--authenticationDatabase Brandon --db Brandon 

The output will look like this (when exporting from Compose):

This will dump the database in whichever directory your terminal is currently in.  
If you are unsure what directory you are in, type 'pwd' in the terminal.
$ pwd  

The dump file will be in a folder named 'dump.'  Within that folder your database files will be inside of a folder with the name of your database.  You will need to know the directory which the dump is in for when you upload the database to Modulus.


mongorestore -h proximus.modulusmongo.net -u user -p pass
  --authenticationDatabase dbId --db dbId path/to/dump

In the above commands dbId is the unique id of your database. This can be found by inspecting your connection string.


Web Export

You can also export data directly through the database dashboard by clicking on the Export tab.

There is a 100MB size limit that can be exported using the web interface. To export more than 100MB, use the methods provided above.

Once you select the collections you'd like to export and provide credentials for connecting to your database, a popup will appear with the export progress.

When complete you'll be presented with a link that can be used to download your exported collections. The export format is identical to that produced by the mongoexport tool.

Restoring database to Modulus

Now that you have successfully dumped your database to your local machine we will restore the database to Modulus.

You will need to create an empty database in Modulus from your project dashboard.  This empty database will be filled with the contents of your database dump. 

Select 'CREATE' with the necessary details filled in.

Next, select that database in your dashboard and select 'administration' to find out the host URL.

The command you will type in the terminal follows:
$ mongorestore -h hostURL.com:port -u root -p root --authenticationDatabase dbId --db dbId path/to/dump 

Using the above example, the command will look like this:
$ mongorestore -h apollo.modulusmongo.net -u root -p root
--authenticationDatabase abu8Papy --db abu8Papy ~/dump/Brandon 

The output will appear like this:

If you receive any error similar to this:
Failed: restore error: abu8Papy.system.users: 
error creating indexes for abu8Papy.system.users: 
createIndex error: not authorized on 
abu8Papy to execute command 

Make sure to remove any system.example files from the dump folder.  You will not be able to restore these on the public cloud.

Go to top

Contact Us

    Our Support Policy
    Submit a Support Request

  • Public Cloud Support Hours
    9am-5pm EST Mon-Fri
    Outside of these hours response times may be up to 24hrs.

    Submit a support ticket by clicking 'status and support' icon on the left side of this page.

seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
Invalid characters found