MongoDB Migration from 3.4 to 4.4

Hello Everyone,
I’m trying to find best solution for migration all MongoDB cluster from 3.4 to 4.4. the old system is running on MongoDB 3.4 on RedHat 7.7, and I want to move all data with user information to MongoDB 4.4 on Redhat 7.9 on another server. I undertand that I can’t use mongodump/mongorestore utility since it didn’t include user information. I also understand that I can’t use mongoexport since it’s used for collection backup, not whole Database backup. So, I need your help to find the best solution for migrating all DB (not upgrading) to newer MongoDB on another server.

Thank you all in advance.

Regards,
Ahmet

Hi @Ahmet_Gunata

As RHEL 7 supports mongodb 4.4 I would upgrade in-place then move. You don’t mention a replicaset so I will assume a standalone.

Start with a backup.
I would follow the upgrade path 3.4 -> 3.6 -> 4.0 -> 4.2 -> 4.4 (details in each versions release notes). Read the procedures carefully and practice if you can.
Then shut down the database. Copy/Rsync the data directory(recursively) and configuration to the new host.
Start mongo 4.4 on the new host.

Or start with mongodb 3.4 on the new system and do the upgrades there.

Also ensure your client app drivers are using a version that supports 4.4

Hi @chris,
Thank you for answer. Actually I should add more details to my questions.
I’m planning to move some databases in old MongoDB (3.4) to current MongoDB (4.4) which is currently used by some applications.
I think I have to upgrade old MongoDB to newer version as you mentioned , then do mongodump/mongorestore to move databases into current MongoDB.
When I try to do dump/restore directly (dump from 3.4 restore to 4.4), I didn’t get any error on my test environment. Do you think that I can use this method? Is there any restriction about this method?
Regards,
Ahmet

If it works go for it. :+1: