Create Database on Mlab

Mlab 1

  • Select Cloud Provider as Google Cloud Platform, Plan Type as SANDBOX and clic “Continue”

Mlab 2

  • Select the region then click “Continue”

Mlab 3

  • Set the database name

    • Example database name:
      • project-a-dev (for development)
      • project-a-uat (for uat)
  • Click “Continue” button

Mlab 4

  • Confirm the order, Click “Submit Order”

Mlab 5

  • Your database already created

Mlab 6

  • Click your database to configure the users

Mlab 7

  • Click “Users” tab, click “Add Database User”

Mlab 8

  • Set your username add password, then click “Create”

Mlab 9

  • User has been created

Mlab 10

  • Backup your local data, go to “cmd”
mongodump --db YOUR_DB_NAME --excludeCollectionsWithPrefix acl_allows -o YOUR_OUTPUT_DIR
  • Restore to mongolab
restore --host YOUR_MLAB_HOST --port YOUR_MLAB_PORT --username YOUR_MLAB_USERNAME --password YOUR_MLAB_USERNAME --db YOUR_MLAB_DB_NAME YOUR_BACKUP_DIR