mongomove is a utility tool that facilitates the migration of databases from
one MongoDB server to another. It's especially handy for transferring data
between remote servers and local development environments.
go install github.com/bounoable/mongomove/cmd/mongomove@latestgo get github.com/bounoable/mongomoveMove databases from one server to another:
mongomove -source mongodb://127.0.0.1:27017 -target mongodb://127.0.0.1:27018Migrate databases that start with a specific prefix:
mongomove -source mongodb://127.0.0.1:27017 -target mongodb://127.0.0.1:27018 -prefix my_To bypass the confirmation prompt:
mongomove -source mongodb://127.0.0.1:27017 -target mongodb://127.0.0.1:27018 -confirmSpecify the number of documents to process in a single batch (default is 100):
mongomove -source mongodb://127.0.0.1:27017 -target mongodb://127.0.0.1:27018 -b 500Set the number of concurrent database imports. By default, mongomove uses the number of CPUs available:
mongomove -source mongodb://127.0.0.1:27017 -target mongodb://127.0.0.1:27018 -p 2Prevent the creation of indexes during import:
mongomove -source mongodb://127.0.0.1:27017 -target mongodb://127.0.0.1:27018 -indexes falseFor a more detailed output:
mongomove -source mongodb://127.0.0.1:27017 -target mongodb://127.0.0.1:27018 -vMIT.