I want to take a collections data backup on a different host, with renaming the Collections.
I am very new to MongoDB. Please help me with this task.
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It only takes a minute to sign up.
Sign up to join this communityI want to take a collections data backup on a different host, with renaming the Collections.
I am very new to MongoDB. Please help me with this task.
You can with this command rename your collection:
db.rrecord.renameCollection("record")
Then backup with this:
mongodump --host mongodb1.example.net --port 3017 --username user --password "pass" --out /opt/backup/file
Tip: You can specify different host for save your backup file.