Root
Root

Reputation: 147

Mongodb Migration from 2.6 to 3 without mangodump to minimize downtime

Currently we are running mongodb 2.6. In the production environment the instance size is around 70GB. So if we using mongodump do copy data between mongodb versions it would take long time to copy data. We can't have long downtime in the production. So We have planning to use underlying data files copy from OS level. If we copy data files, Is there any issue would come if we use wiredtiger storage engine option in the new version? Please advice. Is there any other open source options available for migration? can we simply point out existing data folder path in the new wired tiger version?

Upvotes: 1

Views: 1356

Answers (1)

Adam Pridmore
Adam Pridmore

Reputation: 163

"In the general case, the upgrade from MongoDB 2.6 to 3.0 is a binary-compatible “drop-in” upgrade: shut down the mongod instances and replace them with mongod instances running 3.0."

from: https://docs.mongodb.org/manual/release-notes/3.0-upgrade/

There are two steps to migrate from V2.6 to V3.0 WiredTiger

  1. Migrate from V2.6 -> V3.0 (but keep the MMapV1 storage engine). The data files between 2.6 and 3.0 are compatible. Also you can make this upgrade (almost) transparent to the application. Stop and upgrade the secondary node binaries and restart. Step the primary down stop, upgrade and restart that. The only downtime is during the primary stepdown of a few seconds.
  2. Migrate from V3.0 MMapV1 -> V3.0 WiredTiger. The data files between MMapV1 and WiredTiger are completely different. But the migration process is quite simple. For each node in the replica set:
    • shut it down.
    • Configure it to use WiredTiger in the config file.
    • Delete the data files.
    • Restart the mongod.

It will then do an initial sync from the another node and store the data using WiredTiger. This can take a while but so long as you replication lag is big enough should be a problem. 70Gb doesn't sound all that large! We're in the process of managing these steps for a 7Tb cluster and aren't too concerned.

More details are here:

https://docs.mongodb.org/manual/release-notes/3.0-upgrade/#change-replica-set-storage-engine-to-wiredtiger

Upvotes: 3

Related Questions