Question

I have to move a 200GB MongoDB from one server to another (both Windows 2016 OS). During this operation, it is assumed that the accompanying program will be offline, so no need to worry about inconsistent data, but I need to minimize the downtime. Diskspace is not an issue, but downtime is. I've tried testing it with mongodump and mongorestore, but that took almost 20 hours to complete, which seems pretty ridiculous. I'm looking at a couple other options:

  1. Use copydb
  2. Take a snapshot of the disk and/or copy the db folder directly to the new server and point the installation to that by changing the path in the .conf file.

I'm guessing #2 would be fastest if it will work, but I haven't found any real confirmation that it works on a Windows platform. Has anyone successfully done this? If so, is it as simple as I described? As mentioned, MongoDB and its accompanying program can be turned off completely for this operation.

Alternatively, can anyone give me a ballpark figure on how long copydb takes versus a mongodump/mongorestore operation?

Was it helpful?

Solution

Final solution: We went with option #2 - turning off MongoDB and manually copying the database files over to the new server. It worked like a charm. For future database migrations and changes, I will probably be making a replica set as suggested by @SqlWorldWide and @Markus. That looks like it would definitely the best solution for someone who has time to properly plan a migration.

Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange
scroll top