What this thread does
Do first: configure replication.replSetName: "rs0" for the existing development server, then initialize that set with rs.initiate() after restarting it.
Short answer
As of November 2026, MongoDB 9.0.8, November 10, 2026 is the release baseline; conversion guidance follows current self-managed documentation. A standalone server cannot run multi-document transactions. (proof). Use a supported server and preserve its existing data directory.
Choose / don't choose
- Single-node development set: choose to exercise transactional application behavior on one machine; don't treat it as production availability. Brock Leonard's September 2023 reply describes the stop/configure/start/initialize sequence for the reported transaction error.
- Production replica set: choose a redundant deployment. The production considerations call for multiple nodes; the conversion guide's intermediate single-primary state is not a production architecture.
- Single-document operation: retain the simpler atomic document update when the invariant fits one document (transactions).
Not for: Atlas network access failures; see mongodb-atlas-connection-timeout-from-deployed-app-ip-access-list.
Settings that matter
| Setting or flag | Value / default | Applies to | Source |
|---|---|---|---|
replication.replSetName | "rs0" in the conversion example; use one matching set name for members | MongoDB 9.0 configuration / current conversion docs | config, conversion |
URI replicaSet | rs0 when that is the initialized set name; match case and actual topology | Current driver connection-string docs | URI option |
URI directConnection | Default false discovers members; true may be appropriate for a development Docker set exposing only one endpoint | Development discovery limitation | URI option |
storage.engine | wiredTiger is the default; the transaction primary must use WiredTiger | MongoDB 9.0 / current transaction docs | configuration, requirements |
featureCompatibilityVersion | Replica-set minimum 4.0; use a supported server's compatible FCV, not an unsupported historical binary | Current transaction requirements | FCV |
Order of operations
1. Stop application writes, preserve a backup and shut down the standalone instance. Follow the conversion steps (conversion). 2. If client authorization is enabled, configure member authentication too: the conversion guide requires X.509 or keyfiles. Preserve network restrictions and existing access control; disabling authentication is not a repair (conversion). 3. Reconnect with mongosh and run rs.initiate() once. The optional configuration can specify the set and advertised member address; use a hostname reachable by the client. Then inspect rs.conf() and rs.status() (conversion, initialization). 4. Wait until db.hello() reports isWritablePrimary: true. (proof). 5. Reconnect the application using, for example, mongodb://mongodb0.example.net:27017/?replicaSet=rs0; the hostname is illustrative. Check the endpoint the application actually reaches, the initialized set name, primary state and FCV. (URI options). 6. Only then begin session transactions. Replica sets require FCV at least 4.0; the primary must use WiredTiger, and any secondaries must use WiredTiger or in-memory storage (requirements). Do not change a storage-engine setting against incompatible existing data as a shortcut; plan a separate data migration if needed.
Known failures and fixes
Diagnostic: Transaction numbers are only allowed on a replica set member or mongos
| Error (short quote) | Cause | Fix | Source |
|---|---|---|---|
Transaction numbers are only allowed on a replica set member or mongos | Application still reaches a standalone; restarting with a flag/config alone is not the complete conversion | Check the actual service config, rs.status(), matching URI set name and writable primary, then recreate the application connection | Gustavo Castro / Brock Leonard, September 21–22, 2023, conversion |
MongoNetworkError | The shutdown command deliberately closes the shell's connection | Expected during the shutdown step; restart with the correct config and reconnect before initialization | shutdown response |
Missing
- Current production guidance says multiple nodes.
- The conversion guide confirms that conversion explicitly passes through a single primary
- The linked source does not confirm: single-node conversion supplies no failover
- The conversion guide requires
rs.initiate()after the set-name configuration and restart - The linked source does not confirm: URI disagreement reaches an old standalone or inaccessible address.
- Transactions require a supported driver/session API. Driver-specific
startTransaction()code and deployment-specific service restart commands are outside this server conversion recipe.
Checked
2026-11-12; MongoDB 9.0.8 release notes, current conversion/configuration/URI/hello/initialization/transaction references and dated Castro/Leonard discussion read. No server, replica-set or transaction commands executed.
Started from a post by @MongoDB, packaged by the editor. Original post