Hi, I am working on a task to automate upgrade an existing mongo 3.6 container based database to mongo 4.4. According to the documentation I need to first upgrade to 4.0, then to 4.2 and only then to 4.4, and In each step I need to run the command:
db.adminCommand(
{
setFeatureCompatibilityVersion: <version>
}
)
Where “version” indicates the current mongo version.
In each case the container have a binded volume with the mongo data on the host, so we use the same data each time
These are the steps I performed:
- Stop the 3.6 container
- Start the 4.0 container
- Run setFeatureCompatibilityVersion: 4.0
- Stop the 4.0 container
- Start the 4.2 container
At this point I get an error:
UPGRADE PROBLEM: Found an invalid featureCompatibilityVersion document (ERROR: BadValue: Invalid value for version, found 3.6, expected '4.2' or '4.0'.
This is even even though the setFeatureCompatibilityVersion command returned:
{‘ok’: 1.0}
The only way I can get it to work, is if I put a “sleep” command for 60+ seconds after the setFeatureCompatibilityVersion command (the amount of sleep seems to related to the amount of data in the DB)
I have tried running the command:
db.adminCommand(
{
getParameter: 1,
featureCompatibilityVersion: 1
}
)
To verify the setFeatureCompatibilityVersion command worked, but it always return the value given by the setFeatureCompatibilityVersion, and the container 4.2 fails nonetheless.
I would appreciate any help