Docs Menu

Docs HomeLaunch & Manage MongoDBMongoDB Atlas

Convert a Serverless Instance to a Dedicated Cluster

On this page

  • Prerequisites
  • Migrate Using mongodump and mongorestore

You can manually migrate your data from a serverless instance to a dedicated cluster. To migrate your data, you can do one of the following:

To manually migrate your data from a serverless instance to a dedicated cluster, you must have the following:

  • A dedicated cluster that runs the same major version of MongoDB as the serverless instance from which you want to migrate data.

  • The following command-line tools:

1

To connect to your serverless instance and retrieve the data, do the following in the Atlas UI:

  1. Navigate to the Database Deployments page for your project.

  2. Click the (ellipsis) for the serverless instance and select Command Line Tools from the dropdown.

    The Cmd Line Tools tab displays.

  3. In the Binary Import and Export Tools section, copy the mongodump command to create a binary export of the contents of a database.

    For example:

    mongodump --uri
    mongodb+srv://{username}:<PASSWORD>@test.jca5k.mongodb.net/<DATABASE>

To learn more, see Connect to a Cluster using Command Line Tools.

2

To run the mongodump command that you copied, do the following in a terminal:

  1. Paste the mongodump command that you copied into the terminal.

  2. Replace the <PASSWORD> in the string with the password of the user.

  3. Replace the <DATABASE> in the string with the name of the database that you want to migrate to the dedicated cluster.

  4. Run the mongodump command.

    When you run mongodump, the command copies the contents of the specified database into the dump/ sub-directory of the current directory. If the dump directory doesn't already exist, the command creates the directory and copies the data into that directory.

  5. Repeat these steps for each database that you want to migrate to the dedicated cluster.

3

To connect to your dedicated cluster and migrate the data, do the following in the Atlas UI:

  1. Navigate to the Database Deployments page for your project.

  2. Click the (ellipsis) for the dedicated cluster and select Command Line Tools from the dropdown.

    The Cmd Line Tools tab displays.

  3. In the Binary Import and Export Tools section, copy the mongorestore command to create a new database or add data to an existing database.

    For example:

    mongorestore --uri
    mongodb+srv://{username}:<PASSWORD>@test.jca5k.mongodb.net

To learn more, see Connect to a Cluster using Command Line Tools.

4

To run the mongorestore command that you copied, do the following in a terminal:

  1. Paste the mongorestore command that you copied into the terminal.

  2. Replace the <PASSWORD> in the string with the password of the user.

  3. Run the mongorestore command.

    When you run mongorestore, by default, the command copies the contents of the dump/ sub-directory of the current directory to the cluster. If you stored the data in a different directory, see mongorestore syntax for the command options to specify a different location.

  4. (Optional) If you are migrating each database individually, repeat these steps for each database that you want to migrate to the dedicated cluster.

5

To confirm that you've successfully migrated your data, do the following in the Atlas UI.

  1. Navigate to the Database Deployments page for your project.

  2. Do one of the following on the dedicated cluster where you copied the data:

    • Click Browse Collections and visually verify that data has been migrated to the cluster.

    • Click Connect to connect to your cluster and run queries against the data.

← Auto-Create Indexes for Serverless Instances