Haseeb
Haseeb

Reputation: 1134

Older data folder not working on MongoDB upgrade

On MongoDB upgrade from 3.2 to 5.0, I set dbpath same as I set for 3.2, but it is not working. It works when I create a new data folder.

Is there any way we can use older data folder without taking backup with mongodump and restore that after installation?

Upvotes: 0

Views: 131

Answers (1)

Joe
Joe

Reputation: 28326

Short answer: No.

Long answer: Yes, if you are glutton for punishment.

Upgrading from 3.2 to 5.0 without dump/restore would mean taking the following steps, in order:

  1. Upgrade all members of the replica set to MongoDB 3.4
  2. Upgrade all members of the replica set to MongoDB 3.6
  3. Set the feature compatibility version to "3.6"
  4. Upgrade all members of the replica set to MongoDB 4.0
  5. Set the feature compatibility version to "4.0"
  6. Upgrade all members of the replica set to MongoDB 4.2
  7. Set the feature compatibility version to "4.2"
  8. Upgrade all members of the replica set to MongoDB 5.0

You will need to read the release notes and upgrade instructions for each version to make sure you allow any data file/index upgrades to complete, remove any unsupported options (like MONGODB-CR authentication) that may be in use, etc.

I suspect that the realistic answer here is that it will be a lot simpler to just dump and restore the data.

Upvotes: 1

Related Questions