Upgrading older mongo database after unintentional mongo version upgrade
I solved the problem by installing the older version of mongodb on a system for which it wasn't a problem to get it pre-packaged (well, Windows 10, even though oficially it's stated the package is for Windows Server 2008), copying the database files (contents of /var/lib/mongodb
) there, running it with --dbpath
param (mongod --dbpath /path/to/dbfiles
), setting the compatibility flag according to the docs and finally copying the db files back to the server.
Would like to know about a better option, but it's good to know the db files are easily transferable to another system, even another architecture (the db was relatively simple and small though).
here similar issue, unintentionally upgrade from 4.2.1
to 4.4.3
, then mongodb can NOT started..
Final worked solution:
- uninstall (latest, but not worked version:
4.4.3
)
brew uninstall mongodb-community
- reinstall, old but worked
4.2.1
brew install mongodb-community@4.2
- run
- for now:
brew services run mongodb-community@4.2
- for now and set bootable:
brew services start mongodb-community@4.2
- check status
brew services