Use backup restore and upgrade at same time

we have mongo 5.0.5 CE installed on linux redhat 7. I created a backup with dump command.

now our rpm db is corrupted and I received a new server redhat 8. I installed latest version 6.0 of mongo. Is the restore supporting a dump from lower version ? I get all msg … skipping file…

or do we have to install first the same version 5.0.5 - restore - upgrade mongo to 6.0

thanks for all help, best regards, Guy

Hi @Guy_Przytula - Welcome to the community.

As per the mongorestore documentation:

When using mongorestore to load data files created by mongodump , be sure that you are restoring to the same major version of the MongoDB Server that the files were created from. For example, if your dump was created from a MongoDB Server running version 4.4.x , be sure that the MongoDB Server you are restoring to is also running version 4.4.x .

In addition, ensure that you are using the same version of mongorestore to load the data files as the version of mongodump that you used to create them. For example, if you used mongodump version 100.5.4 to create the dump, use mongorestore version 100.5.4 to restore it.

In short specific to this scenario you’ve described; restore to the same MongoDB version and then upgrade to 6.0. See the documentation for more information regarding the Upgrade of a standalone to 6.0 (You can find the associated Replica Set and Sharded Cluster upgrade procedures and notes on the left hand side of the linked documentation).

Hope this helps.

Regards,
Jason

1 Like