Skip to content

Instantly share code, notes, and snippets.

@ryanvgates
Created May 5, 2021 21:49
Show Gist options
  • Save ryanvgates/b8804984b84360ef78d43606144c5cd3 to your computer and use it in GitHub Desktop.
Save ryanvgates/b8804984b84360ef78d43606144c5cd3 to your computer and use it in GitHub Desktop.
Rename MongoDB With Restore
mongorestore --dryRun -v --gzip --uri="mongodb://user:[email protected]:27017,replicaset-1-1.com:27017,replicaset-1-2.com:27017/new_db_name?authSource=new_db_name&replicaSet=resp1&ssl=true" --nsInclude=old_db_name.* --nsTo=new_db_name.* --nsFrom=old_db_name.* --ssl --archive={filename from above}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment