Tuesday, May 3, 2016

MongoDB dump/restore without temporary files

In MongoDB 3.2 new option --archive is available in mongodump and mongorestore which allow to to copy databases without temporary directories:

mongodump --host=localhost:37017 --db=userstate_10b --archive | mongorestore --host=localhost:27017 --drop --archive
MongoDB 3.2 also has a new --gzip option which in this case doesn't make sense to use, because mongodump and mongorestore are running on the same machine.

No comments:

Post a Comment