I have a Pritunl server on Debian Bullseye and need to upgrade to Debian Bookworm, but my version of MongoDB 3.1.11 seems to be incompatible with the latest Debian. What is the best way to update MongoDB without losing data? Is there a guide available? Has anyone else encountered this situation?
I probably will look at the mongo DB procedure. There’s some issue to pay attention in the pritunl ecosystem?
Before attempting to upgrade the database run mongodump --db=pritunl. With MongoDB it will require upgrading 1 release at a time starting with MongoDB 3.2 upgrade. This would be about 6 steps from that release. It may be better to export the database as documented in the backup documentation and install the latest MongoDB with an empty database as shown below. Then import the database back and run sudo pritunl destroy-secondary to clear the cache data in the database. Sometimes sudo pritunl repair-database is also needed this will also rebuild the IP pools.
I’m on debian and will utilize the .deb package.
The above code should be applied to every version of mongo 3.2 - 3.4 - 3.6 - 4.0 - 4.2 - 4.4 - 5.0 - 6.0 ?
No you would need to search Google or the MongoDB documentation for the upgrade instructions for each of those versions. This should be update the repository file to update the package. Then updating the feature compatibility version.
The commands above can be used to skip to the latest release and import a backup of the database.
The issue in v7 was fixed several months ago, that is the current release in the documentation. I don’t have v8 on any test systems yet but there shouldn’t be any issues. The new Pritunl builds from this month have the latest pyMongo library and should have no compatibility issues.