Trying upgrade from v1.12.2 to v4, let me do a record
submitted by
Migrate nodebb to a new machine
from | to | |
---|---|---|
OS | Ubuntu 22.04.5 LTS | Debian 12 |
nvm version | 12 | 20 |
mongodb version | 6 | 8 |
nodebb version | v1.12.2 | v4.2.1 |
Some plugins installed through the old ACP are no longer on the whitelist in the new ACP due to being outdated, making them impossible to uninstall using the new ACP panel. However, while npm uninstall works, they reappear after a reset (could it be that the plugin list is being read from the database?)
My next step is to try and reproduce the previous actions, but in a more condensed way to test the minimum upgrade steps.
Step 1 preconfig
git config --global url."https://github".insteadOf git://github
sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1
Step 2 database
mongodump -u nodebb -p password -d nodebb -o .
mongorestore -d nodebb nodebb/ -v
nvm version 12
./nodebb upgrade
./nodebb dev
Step 3 nodebb
nvm switch to 14
git checkout v1.16.x
git reset --hard origin/v1.16.x
./nodebb upgrade
failedstill failed with nodebb-plugin-emoji-static plugin, success after npm uninstall and remove folder
npm i --verbose
./nodebb upgrade
v1.16.x -> v2.x
nvm switch to 18
git checkout v2.x
git reset --hard origin/v2.x
./nodebb upgrade
successv2.x -> v3.x
git checkout v3.x
git reset --hard origin/v3.x
./nodebb upgrade
successv3.x -> v4.x
nvm switch to 22
git checkout master
git reset --hard origin/master
./nodebb upgrade
successBased on my testing, the main source of upgrade errors appears to be certain outdated plugins. The recommended procedure is to uninstall them via the ACP panel prior to upgrading, then manually uninstall them again with npm in the NodeBB directory and remove their folders from node_modules, and only then perform the upgrade.
First try
Step 1 database
The target machine has MongoDB 7 installed, not 8. To ensure no data errors occur, I will upgrade to version 8 later
First, dump database and restore
mongodump -u nodebb -p password -d nodebb -o database
mongodb auth been disabled while upgrading, so i can import data without auth
mongorestore -d nodebb nodebb/ -v
Step 2 upgrade nodebb
Force git to use HTTPS. This problem cost me hours trying to find a solution. https://stackoverflow.com/a/72391698
git config --global url."https://github".insteadOf git://github
Disabling IPv6 for now. I'm experiencing issues accessing npmjs over IPv6
sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1
v1.12.2 -> v1.13.x/v1.14.x/v1.15.x failed
nvm version 12, error on ./nodebb upgrade. The errors I'm seeing looks like compatibility issue between benchpress and Node.js version 12.
v1.12.2 -> v1.16.x success
nvm switch to 14, some error on ./nodebb upgrade. The upgrade process had some errors, but the outcome wasn't impacted. Once completed, ./nodebb dev works.
v1.16.x -> v1.17.x -> v1.18.x -> v1.19.x success
v1.19.x -> v2.x success
v2.x -> v3.x failed
v2.x -> v3.0.1 successsome error on ./nodebb upgrade. The upgrade process had some errors, but the outcome wasn't impacted. Once completed, ./nodebb dev works.
v3.0.1 -> v3.x failedv2.x -> v3.x success
nvm switch to 18. I removed a plugin that depended on a too-old markdown version, and then the upgrade completed successfully.
v3.x -> v4.x success
nvm switch to 20. failed on v4.x branch, success after switch to origin/master
git checkout master; git reset --hard origin/master