Convert a Serverless Instance to a Dedicated Cluster
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:
Restore data from a scheduled or on-demand Cloud Backup. To learn more about restoring from a snapshot, see Restore from a Scheduled or On-Demand Snapshot.
Migrate data using
mongodump
andmongorestore
. To learn more, see the prerequisites and procedure on this page.
Important
In early 2025, we will release a UI-based tool to assist you in migrating your workloads from Serverless instances to Dedicated clusters. This tool will ensure correct migration and you will not need to change connection strings. There will be some downtime while using this tool.
Prerequisites
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:
Migrate Using mongodump
and mongorestore
In Atlas, go to the Clusters page for your project.
If it's not already displayed, select the organization that contains your desired project from the Organizations menu in the navigation bar.
If it's not already displayed, select your desired project from the Projects menu in the navigation bar.
If it's not already displayed, click Clusters in the sidebar.
The Clusters page displays.
Connect to your Serverless instance using mongodump
to retrieve the data to migrate.
To connect to your Serverless instance and retrieve the data, do the following in the Atlas UI:
Click the (ellipsis) for the Serverless instance and select Command Line Tools from the dropdown.
The Cmd Line Tools tab displays.
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.
Run the mongodump
command in a terminal to retrieve the data.
To run the mongodump
command that you copied, do the
following in a terminal:
Paste the
mongodump
command that you copied into the terminal.Replace the
<PASSWORD>
in the string with the password of the user.Replace the
<DATABASE>
in the string with the name of the database that you want to migrate to the dedicated cluster.Run the
mongodump
command.When you run
mongodump
, the command copies the contents of the specified database into thedump/
sub-directory of the current directory. If thedump
directory doesn't already exist, the command creates the directory and copies the data into that directory.Repeat these steps for each database that you want to migrate to the dedicated cluster.
In Atlas, go to the Clusters page for your project.
If it's not already displayed, select the organization that contains your desired project from the Organizations menu in the navigation bar.
If it's not already displayed, select your desired project from the Projects menu in the navigation bar.
If it's not already displayed, click Clusters in the sidebar.
The Clusters page displays.
Connect to your dedicated cluster using mongorestore
to migrate the data to that cluster.
To connect to your dedicated cluster and migrate the data, do the following in the Atlas UI:
Click the (ellipsis) for the dedicated cluster and select Command Line Tools from the dropdown.
The Cmd Line Tools tab displays.
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.
Run the mongorestore
command in a terminal to retrieve the data.
To run the mongorestore
command that you copied, do the
following in a terminal:
Paste the
mongorestore
command that you copied into the terminal.Replace the
<PASSWORD>
in the string with the password of the user.Run the
mongorestore
command.When you run
mongorestore
, by default, the command copies the contents of thedump/
sub-directory of the current directory to the cluster. If you stored the data in a different directory, seemongorestore
syntax for the command options to specify a different location.(Optional) If you are migrating each database individually, repeat these steps for each database that you want to migrate to the dedicated cluster.
In Atlas, go to the Clusters page for your project.
If it's not already displayed, select the organization that contains your desired project from the Organizations menu in the navigation bar.
If it's not already displayed, select your desired project from the Projects menu in the navigation bar.
If it's not already displayed, click Clusters in the sidebar.
The Clusters page displays.
(Optional) Confirm that you've successfully migrated data to the dedicated cluster.
To confirm that you've successfully migrated your data, do the following in the Atlas UI.
Do one of the following on the dedicated cluster where you copied the data:
Review the Atlas UI:
Click the Browse Collections button for your cluster.
The Data Explorer displays.
Visually verify that data has been migrated to the cluster
Click Connect to connect to your cluster and run queries against the data.