For AI agents: a documentation index is available at https://www.mongodb.com/docs/llms.txt — markdown versions of all pages are available by appending .md to any URL path.
Docs Menu

transitionFromDedicatedConfigServer (database command)

transitionFromDedicatedConfigServer

New in version 8.0.

Starting in MongoDB 8.0, you can:

  • Configure a config server to store your application data in addition to the usual sharded cluster metadata. A config server that stores application data is called a config shard.

  • Transition between a config shard and a dedicated config server.

Every sharded cluster requires a config server. A config shard qualifies as a config server. Use a config shard instead of a dedicated config server to reduce the number of required nodes and simplify your deployment.

A dedicated config server requires its own replica set. A config shard combines the config server role with an existing shard replica set, so your cluster needs fewer replica sets and costs less. Using a config shard has no measurable performance impact at low shard counts.

A dedicated config server isolates cluster metadata from application data. Certain features require this isolation. To learn which deployment fits your cluster, see Config Shard Use Cases.

The transitionFromDedicatedConfigServer command configures a dedicated config server to run as a config shard.

Before you run transitionFromDedicatedConfigServer, connect to mongos and use the admin database.

The sharded cluster must have featureCompatibilityVersion set to at least 8.0.

Command syntax:

db.adminCommand( {
transitionFromDedicatedConfigServer: 1
} )

The transitionFromDedicatedConfigServer command adds the config server as a shard in the cluster. Internally, transitionFromDedicatedConfigServer runs the addShard command.

You can confirm that a sharded cluster uses a config shard by using one of the following methods:

  • Run the sh.isConfigShardEnabled() method in mongosh. If the sh.isConfigShardEnabled() output contains enabled: true, the cluster uses a config shard. If the output contains enabled: false, the cluster does not use a config shard.

  • Run the listShards command against the admin database while connected to a mongos and inspect the output for a document where _id is set to "config". If the listShards output does not contain a document where _id is set to "config", the cluster does not use a config shard.

For details, see Confirm use of Config Shard.

If you must downgrade the feature compatibility version below 8.0, first run the transitionToDedicatedConfigServer command. For downgrade details, see Downgrade Feature Compatibility Version.

If access control is enabled, the transitionFromDedicatedConfigServer command requires the transitionFromDedicatedConfigServer authorization action for the cluster:

{
resource: { cluster : true },
actions: [ "transitionFromDedicatedConfigServer" ]
}

The clusterManager role has transitionFromDedicatedConfigServer authorization action and can be assigned to a user.

The following example assigns the clusterManager role to a user named testUser:

db.grantRolesToUser(
"testUser",
[ "clusterManager" ]
)

The following example configures a dedicated config server to run as a config shard:

db.adminCommand( {
transitionFromDedicatedConfigServer: 1
} )