Content
You are here:
Guide: How to Upgrade Postgre from version 10 to 13 (and OpenProject from version 12.5.8 to 13.0.0)
Here is an alternate method to upgrade both:
- Postgre from version 10 to 13.
- OpenProject from version 12.5.8 to 13.0.0.
The official guide is here. However, as a Docker newbie, I couldn't quite follow the guide. Also, I don't think the official guide works with Portainer since Portainer can only run Docker Compose scripts but cannot run Docker Compose commands.
This relates to Docker running on Windows.
Steps:
- Run Docker Compose Down.
- Backup all data volumes.
- If using Docker Desktop, open this location in Windows file explorer: [\\wsl$\docker-desktop-data\data\docker\volumes](file:///docker-desktop-data/data/docker/volumes)
- If using Rancher Desktop, open this location in Windows file explorer: [\\wsl.localhost\rancher-desktop-data\mnt\wsl\rancher-desktop\run\data\var\lib\docker\volumes](file:///rancher-desktop-data/mnt/wsl/rancher-desktop/run/data/var/lib/docker/volumes)
- Fyi: Don't backup the two files "backingFsBlockDev" and "metadata.db". Will see them at the same folder level as the volume folders. For whatever reason backing-up these two files consumes unlimited amounts of data.
- Install the PGAdmin app. We will use this later to connect directly to Postgre.
- In the docker compose file->Postgre section, expose port 5434.
- Fyi: 5432 is the default port for Postgre.
- Fire up the older OpenProject 12.5.8 (which uses Postgre ver 10).
- In the PGAdmin app, backup the database.
- Make sure to select the option to include data in the backup.
- Shut down the docker stack. Then delete all containers and volumes. We will start with a fresh installation of Postgre version 13 in steps below.
- In Docker Compose, keep OpenProject at version 12.5.8. However, change the Postgre database to version 13. This is the key step! Run Docker Compose to fire up the stack.
- Using pgAdmin, delete the OpenProject database. We will restore this from our backup in a later step below.
- Fyi:
- May need to turn-off all other containers besides the container that runs Postgre.
- If PGAdmin still complains about open connections then stop/restart the container for Postgre.
- Fyi:
- Using pgAdmin, create a new bare bones database called "openproject".
- Using PgAdmin, restore the backup database for "openproject".
1. Fyi: I noticed some immaterial errors when running the first half of the restore. However, the second half of the restore (mainly to insert data) worked OK. - Note: At this point, we have: 1. OpenProject version 12.5.8 2. Postgre version 13.
- Run Docker Compose Down to shut down the docker stack.
- Edit the Docker Compose script to change OpenProject to version 13.0.0 (could maybe go higher but I wanted to take it one step at a time).
- Run Docker Compose Up to upgrade OpenProject to 13.0.0.
- (optional) Repeat steps #12, #13, #14 to upgrade to higher versions of OpenProject (greater than 13.0.0).
Done!