Skip to main content

Posts

Showing posts from July, 2016

Data Migration from Development to Production environment

We have to migrate data from dev to Prod( Sharded Environment). We will use mongoDump and mongoRestore utility. MongoDump:  Used to create binary export of the contents of the database. It does not include index data. It requires to rebuild index after restoring the data. Futher Reference from MongoDB  MongoRestore: Used to import binary content from dump to the MongoDB instance. Further Reference from MongoDB Take dump from Dev Server as: mongodump  --host  dev_hostname:port  -u user -p ****** --authenticationDatabase db_name_where_authentication_checks --db dbname --collection collection_name   A dump folder created includes bson file. SCP that file to the Production server Then restore as:  mongorestore --host prod_hostname:port  -u user -p ******  --authenticationDatabase db_name_where_authentication_checks  --collection collection_name --db dbname  path_to_dump_bson  ...