Create a Relational Migrator User in MongoDB
On this page
To run a data migration job, Relational Migrator requires MongoDB account
credentials with the readWrite
role on the target database. This
page describes the procedure to make a user in your MongoDB database.
Steps
Relational Migrator can connect to an Atlas cluster or an on-premises deployment. Select the tab corresponding to your deployment type.
Use mongosh
to provision a user account that has
readWrite
access to your data migration target database.
The example commands assume your deployment is running on localhost
on the default port of 27017
, and that you're creating a user to
access the MongoEnterprises
database.
For more information on connecting to MongoDB using mongosh
, see
Connecting to your MongoDB Deployment.
Connect to your deployment using mongosh
You must use an account that can run createUser
on the admin and MongoEnterprises
databases.
mongosh "mongodb://myadminuser:myadminpassword@localhost:27017/admin"
Create the service user in the admin
database for authentication
Run the following command to create a
migrator-service
user with a password of your choice and
readWrite
access to the MongoEnterprises
database:
use admin db.createUser( { user: "migrator-service", pwd: "password", roles:[{role: "readWrite" , db:"MongoEnterprises"}] } )