Mongodump/mongorestore cross version compatibility

I have a version 2.4.4 MongoDB replication set that isn’t behaving well. I’d like to upgrade to the latest version supported by my app (3.0).

I’ve done a backup using mongodump of the 2.4 database. Can I restore that to 3.0 using mongorestore? I was thinking that I would restore the data to a new 3.0 instance, and then create the replica set. Would that work?

I understand that I can do a binary file replacement to upgrade from 2.4 to 2.6, and then to 3.0. The reason I’d like to reload the data because many of the databases are obscenely large. For example, there’s a database that has 0 records but consumes 92GB of disk storage.

If mongodump/mongorestore aren’t cross version compatible, could I go through the upgrade process to 2.6, followed by 3.0, and then do a backup/restore?

Thanks for your help.

Hey @George_Sexton

Technically it’s not supported, but generally, newer versions of MongoDB add features and thus should be a superset of an older version (in most cases anyway), but of course this would probably different on a case-by-case basis. I would suggest you try this with your backup to a test environment and see if there’s any error and the restore is usable.

It should be possible. For recent MongoDB versions, there’s a page for this: Restore a Replica Set from MongoDB Backups. I don’t think the procedure would be very different on old MongoDB versions, but I would encourage you to test them to be sure.

Yes I think so. Either that, or a rolling initial sync should do it.

I’d still note that all the versions we’re talking about are unsupported, and thus if any issue arises due to a bug in the server, it won’t get fixed anymore.

Best regards
Kevin

3 Likes

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.