Table of Contents

Migration from 9 to 10

Current version 9.0.4 (Mysql2)

New system

Install Debian 9.11 !!!.

Refer to instruction https://www.openproject.org/download-and-installation/ to install OP.

apt-get install apt-transport-https
/etc/apt/sources.list.d/openproject.list
# deb https://dl.packager.io/srv/deb/opf/openproject/stable/10/debian 10 main
deb https://dl.packager.io/srv/deb/opf/openproject/stable/9/debian 9 main
apt-get update
apt-cache policy openproject
apt-get install openproject=9.0.4-1570023722.b1f1184d.stretch
sudo openproject configure

Choose:

Now we have running OP9.0.4 with PGSql.

install pgloader

refer to https://www.openproject.org/operations/migration-guides/migrating-packaged-openproject-database-postgresql/

wget -qO- https://dl.packager.io/srv/opf/pgloader-ccl/key | sudo apt-key add -
sudo wget -O /etc/apt/sources.list.d/pgloader-ccl.list \
  https://dl.packager.io/srv/opf/pgloader-ccl/master/installer/debian/9.repo
sudo apt-get update
sudo apt-get install pgloader-ccl

import backup

All backup parts are simply compressed directories and can be unpacked (or simply rsynced from another host). Only database dump need to be imported.

Rsync command:

rsync -r -a -v -e ssh root@REMOTE:/var/db/openproject/files/ /var/db/openproject/files

import mysql dump

apt-get install mysql-server
mysql
CREATE USER 'openproject'@'localhost' IDENTIFIED BY 'password';
CREATE DATABASE openproject CHARACTER SET utf8mb4;
GRANT ALL PRIVILEGES ON openproject.* TO 'openproject'@'localhost';
\q

Configure openproject for mysql:

Restore backup dump:

zcat mysql-dump-20191211011301.sql.gz | mysql -u openproject -p openproject

Restart service:

systemctl restart openproject

Set database URL to previously created postgresql database:

openproject config:set DATABASE_URL=postgres://openproject:...@127.0.0.1:45432/openproject

Migrate database:

sudo openproject run ./docker/mysql-to-postgres/bin/migrate-mysql-to-postgres

Remove mysql:

apt-get remove mysql-server
openproject config:unset MYSQL_DATABASE_URL

Restart service:

systemctl restart openproject

Upgrade OP to 10

/etc/apt/sources.list.d/openproject.list
deb https://dl.packager.io/srv/deb/opf/openproject/stable/9/debian 9 main
deb https://dl.packager.io/srv/deb/opf/openproject/stable/10/debian 9 main
apt-get update
apt-cache policy openproject
apt-get install openproject=10.0.0-1569215906.69231eeb.stretch
sudo openproject configure
 
apt-get upgrade
sudo openproject configure