This page shows how to save a new MongoDB connection from the Connections tab. You can use a saved connection for any task that requires connecting to a database.
Note
Relational Migrator does not support MongoDB to MongoDB migrations. For information on supported databases, see Supported Databases and Versions.
For information on migrating between MongoDB clusters, see MongoDB Cluster-to-Cluster Sync.
About this Task
To save a MongoDB connection in Relational Migrator, you must:
Identify your database connection string or database information.
Connect to MongoDB.
Important
To plan your migration and map your relational schema to a MongoDB schema, you must connect using an account with the correct read permissions.
To migrate data, you must connect to MongoDB using a service account with the readWrite role. For information about creating a MongoDB user with the required permissions, see Create a Relational Migrator User in MongoDB.
Steps
Database Connection String
Relational Migrator supports all MongoDB connection string options except appName. It overrides appName when connecting to your MongoDB deployment.
Atlas Connection URI
mongodb+srv://username:password@clusterurl.mongodb.net/database
For example, to use an account named migrator-service with password hunter2 to connect to the MongoEnterprises database:
mongodb+srv://migrator-service:hunter2@cluster1.abc123.mongodb.net/MongoEnterprises
On-Premises Connection URI
mongodb://username:password@host:port/database
For example, to use an account named migrator-service with password hunter2 to connect to the MongoEnterprises database:
mongodb://migrator-service:hunter2@localhost:27017/MongoEnterprises
Using X.509 Authentication
To connect to MongoDB using X.509 authentication, omit a username and password. Instead, specify the on-premises host and port or the Atlas cluster URL, the database name, and the following options:
<mongodb:// or mongodb+srv://><on-premises host:port or clusterurl.mongodb.net>/<database>?authSource=$external&authMechanism=MONGODB-X509&tls=true&tlsCertificateKeyFile=</path/to/cert/client.p12>&tlsCertificateKeyFilePassword=<certpassword>
Option | Value | ||
|---|---|---|---|
| |||
| |||
| |||
Path to the IMPORTANT: Unlike other MongoDB products, Relational Migrator requires a path to a | |||
Password to decrypt the |
For example, to connect to the MongoEnterprises database on cluster1.abc123.mongodb.net, using the certificate file /etc/ssl/caToValidateServerCertificates.p12 with the password verysecure:
mongodb+srv://cluster1.abc123.mongodb.net/MongoEnterprises?authSource=$external&authMechanism=MONGODB-X509&tlsCertificateKeyFile=/etc/ssl/caToValidateServerCertificates.p12&tlsCertificateKeyFilePassword=verysecure
For more information on connection string components, see the MongoDB Database Manual.
Connect to MongoDB
To save a new connection from the Connections page:
Enter the MongoDB connection string
In MongoDB connection string (URI), enter your MongoDB URI.
If you're using X.509 authentication, Relational Migrator verifies the connection string syntax and the certificate file format.
If it isn't included in the connection string, enter the Database to connect to.
If they aren't included in the connection string and you aren't using X.509 authentication, enter the Username and Password of your Relational Migrator MongoDB user.
Checking Save password saves the password securely on your machine, so you don't have to enter the Username and Password again when using the saved connection.
If you leave the Database, Username, or Password blank, Relational Migrator uses the values from the URI.