Opened 20 months ago
Last modified 20 months ago
#67148 assigned defect
mongodb: Database cleared with upgrade from v5 to v6
Reported by: | TheDigitalOrchard (The Digital Orchard) | Owned by: | ryandesign (Ryan Carsten Schmidt) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | |
Keywords: | Cc: | ||
Port: | mongodb |
Description
I was surprised to see that MacPorts was automatically offering to upgrade from MongoDB v5 to v6 without any warnings. After the upgrade was completed, all databases were wiped. I can't find them anywhere. Is this a known issue?
Normally, MongoDB requires a specific "compatibility" update to existing databases when upgrading to new minor or major versions. This is the first time (in 8 years) that I've seen MacPorts do the upgrade without any warning. I have seen databases disappear in the past, but it seemed to be anamoly, as they magically reappeared after a reboot. This time, no such luck.
Did I miss a notice during the upgrade?
Change History (2)
comment:1 Changed 20 months ago by TheDigitalOrchard (The Digital Orchard)
comment:2 Changed 20 months ago by ryandesign (Ryan Carsten Schmidt)
Owner: | set to ryandesign |
---|---|
Status: | new → assigned |
Summary: | Database cleared with upgrade from v5 to v6 → mongodb: Database cleared with upgrade from v5 to v6 |
There's nothing in the mongodb Portfile that should result in databases being wiped upon upgrade.
It is true that there was not any explicit warning that sudo port upgrade mongodb
would increase the major version of mongodb, beyond, of course, the output of port outdated
prior to doing the update. This is no different than how all prior upgrades of mongodb were handled in MacPorts, though it is different from how most of the other database ports are handled in MacPorts. MySQL, PostgreSQL, and BerkeleyDB ports do offer separate versioned ports so that the user can decide when to do a major version update. Especially considering upstream's lack of support for older versions of macOS, it is possible that we might want to switch to versioned mongodb ports; it hasn't been done thus far because nobody has requested it yet.
sudo port unload mongodb
should stop the mongod
process. Certainly restarting the computer will stop all processes.
UPDATE
Running
sudo port unload mongodb
was not stopping themongod
process, which I found unusual. This is even after a complete reboot of the system.Manually stopping the process and then running
sudo port load mongodb
restarted the process, and all existing databases were available once again.I've seen this happen before. I previously had a Homebrew installation of MongoDB installed (due to the MacPorts version crashing), but I believe that I had uninstalled this HomeBrew version. Maybe it stuck around and that's why the database directory is different? I'll investigate that further.
For now, the databases are back again, so that's good.