Upgrading Bitnobi - myantandco/RA-BitnobiPilotJuly2020 GitHub Wiki

1. Record your Bitnobi Version Numbers.

If you already have Bitnobi deployed, upgrading to a new version with minor changes should only require stopping Bitnobi, pulling in new docker images and starting Bitnobi again.

Every once in a while a new Bitnobi version may have structural changes in the backend image that require some migration steps. These are listed in the Change Log wiki page keyed by build date and version number.

Retrieve the version numbers of your current Bitnobi deployment to see if a migration step will be required after upgrading your Bitnobi images. The steps are:

  • Log into your Bitnobi UI as any user.
  • Click on the user icon in the upper right hand corner of the UI and select About App. This will pop up a dialog box.
  • Record the build date, Frontend version number (e.g. 0.2.3) and Backend version number (e.g. 0.5.6)

For the following steps use SSH to log into the server hosting Bitnobi, open a terminal window and change to the directory where Bitnobi is installed (e.g. ~/ra-bitnobi)

2. Backup Bitnobi

It is recommended that you backup the current state of Bitnobi just to be safe:

./stop.sh  
cd ..
sudo cp -rp bitnobi bitnobi.bak

This will create a new directory with a copy of your current Bitnobi system state.

3. Pull updated docker images

Login to the dockerhub repository using your assigned userid/password and then pull the desired image version to your server. The bitnobi-jupter and bitnobi-mongodb images rarely need to be replaced, but check the Change Log to confirm.

docker login
docker pull pvytas/ra-bitnobi-backend
docker rmi ra-bitnobi-backend
docker image tag pvytas/ra-bitnobi-backend ra-bitnobi-backend
docker pull pvytas/ra-bitnobi-frontend
docker rmi ra-bitnobi-frontend
docker image tag pvytas/ra-bitnobi-frontend ra-bitnobi-frontend

4. Run Migration if Needed

Check the Change Log wiki page to see if the migration needed for this update and if any additional scripts need to be replaced. It is OK to skip versions (e.g. upgrade from BE v0.5.4 to v0.5.6) but if any of the intermediate versions have migration steps you will need to apply them.

To run the migration command:

./migrate-bitnobi-be.sh

Verify that migration was successful by looking at the log files:

more logs/migration-error.log
more logs/migration-out.log

The migration-error.log should be empty and the migration-out.log file should display something like:

info: executing require() on all .js files in app/models ...
info: executing require() on all .js files in migration/migration-scripts ...
info: Checking if migration required for 'export fix' for Issue #342
info: Empty source collection or OwnerId's already exists in the documents - Skipping migration for 'export fix' for Issue #342
info: ====================================================================
info: All migrations completed
info: ====================================================================

Note that the migrations test if an action is needed before performing it. Running the migration a second time will have no effect.

5. Start Bitnobi

Restart the Bitnobi processes in the usual way:

./start.sh

Go to the logs directory and examine the server-out.log file. The start of this file should show a successful connection to MongoDB, and a vault status of "sealed":false. There should be no error messages.

⚠️ **GitHub.com Fallback** ⚠️