Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Get the MongoDB URIs

    • Obtain the source MongoDB URI in the format: mongodb+srv://<username>:<password>@<source-cluster>

    • Get the MongoDB target URI in format from the Galaxy Database team: mongodb://<username>:<password>@<destination-host>:<port>

      image-20240522-193427.png

    • Validate the number of documents.
      We can validate the number of documents inside a MongoDB with the following script.

Code Block
var db = db.getSiblingDB('DATABASE_NAME');  // Connect to the specified database

var collections = db.getCollectionNames();  // Get all collections in the database
var totalDocuments = 0;

for (var coll of collections) {
    totalDocuments += db.getCollection(coll).countDocuments();  // Sum the document count for each collection
}

print("Total documents in DATABASE_NAME: " + totalDocuments);  // Print the total document count

Info

This entire migration procedure should not be used for MongoDB Sharded clusters.

  1. Run the Docker Container

    Use the following command to run the migration container:

    Code Block
    languagesh
    docker run --rm \
      -e SOURCE_URI="" \
      -e TARGET_URI="" \
      -e DB_NAME="simpletask" \
      meteor/galaxy-mongodb-migrate:202409101534
    

    Replace SOURCE_URI, TARGET_URI, and DB_NAME with your actual values.

...