Content
Restoring old OpenProject Docker
Added by Michael Ballard 11 months ago
I may have already messed this up because I thought it was working and deleted my original...I believe I originally installed OpenProject around 2021.
My server died, and instead of replacing a mainboard, I figured I would migrate all my Docker containers to a new machine like I'd planned. I run OpenProject via Docker, with /var/openproject/assets and /var/openproject/pgdata mounted as volumes. I couldn't remember what version of OpenProject I had, so I guessed...11 works, but gives me errors when I try to actually do anything...I can log in, but viewing projects gives me "The data to display the graph could not be loaded. The necesary permissions may be lacking" (image) and an internal error when I try to view Work packages (image).
If I relaunch the container with 12, I get
DATABASE INCOMPATIBILITY ERROR
Database server version mismatch: Required version is 10.0.0, but current version is 9.6.24
If I relaunch with older versions less than 11 such as 10.5 or slightly newer like 11.0.1, I get
-----> Starting the all-in-one OpenProject setup at /app/docker/supervisord...
-----> Database cluster already exists, not modifying.
waiting for server to start..... done
server started
Trying to contact PostgreSQL server instance or waiting for it to come online.
Starting memcached: memcached.
/usr/local/bundle/gems/bundler-2.0.2/lib/bundler/rubygems_integration.rb:198: warning: constant Gem::ConfigMap is deprecated
rake aborted!
ActiveRecord::StatementInvalid: PG::UndefinedColumn: ERROR: column "updated_on" does not exist
LINE 1: SELECT MAX(updated_on) FROM "settings"
^
HINT: Perhaps you meant to reference the column "settings.updated_at".
11.1 behaves the same as 11.
My Docker command is below and I run behind the same nginx reverse proxy that has worked for me for years:
docker run -d -v openproject-assets:/var/openproject/assets -v openproject-pgdata:/var/openproject/pgdata -p 8092:8080 -e OPENPROJECT_SECRET_KEY_BASE=somesecret --name OpenProject --replace=true openproject/community:11
Replies (1)
Database fully recovered. Brief instructions for posterity.
Instructions here: https://www.openproject.org/docs/installation-and-operations/misc/migration-to-postgresql13/
In case that link ever gets abandoned, the steps I took are:
First, create a new volume:
docker volume create openproject-pgdata-next
or similar.Then run it with the below command
I had some permissions issuesreported, resolved by re-running the above command as
From there I ran
chmod 0700 /var/openprojects/pgdata
andchown postgres:postgres /var/openprojects/pgdata -R
in the container.I had another error, but was able to track it down via the error message provided (didn't keep that written down, but it was easy enough to follow). To run the update I could either execute
/app/docker/prod/postgres-db-upgrade
or simply exit the container and run the code above with the upgrade command. Once that was all sorted, and I got the "Upgrade Complete" message, I exited the container and launched with OpenProject version 13 and the new data directory populated from the upgrade,openproject-pgdata-next
.Version 13 and it kept crashing without error messages. Tried again with version 12, and after a few minutes everything was sorted and working: