作者:vectus2001

Ma Chi Hang

Openproject Community Docker Migration to other docker under the other machine

openproject/community version 13 to openproject/community version 13

// command to create new openproject community docker
// Windows Command
docker run -it -p 8080:80 -e OPENPROJECT_SECRET_KEY_BASE=secret -e OPENPROJECT_HOST__NAME=<IP Address>:8080 -e OPENPROJECT_HTTPS=false -e OPENPROJECT_DEFAULT__LANGUAGE=en openproject/community:13

// login to the openproject/community:13 docker in /bin/bash ( new container name : boring_mayer )
// Windows Command
docker exec -it boring_mayer /bin/bash

// login to the new openproject/community:13 postgresql database under the new openproject/community:13 docker ( password : postgres )
// Linux Command
psql -U postgres -h 127.0.0.1

// check the existing database under postgresql database instance
// Postgresql SQL
SELECT datname FROM pg_database;

// drop the openproject database from the new docker postgresql database
// Postgresql SQL
DROP DATABASE openproject WITH (FORCE);

// create blank new openproject database from the new docker postgresql database
// Postgresql SQL
CREATE DATABASE openproject OWNER openproject;

// copy the existing (old) openproject community database backup sql file from windows to docker container home directory
// ( backup – export from openproject system => administration )
// Windows Command
docker cp C:\openproject.sql boring_mayer:/home/app

// restore the database ( password : postgres )
// Windows Command
docker exec -it boring_mayer psql -U postgres -h 127.0.0.1 -d openproject -f /home/app/openproject.sql

// assign setting about auto-start container after hosting machine reboot
docker update --restart=always wonderful_einstein

// restart the docker container boring_mayer from docker desktop / wait for 3 minutes about restart container

// login the system to check the result.