Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

https://docs.openproject.org/installation-and-operations/misc/packaged-postgresql-migration/

No Format
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/ubuntu/18.04.repo
sudo apt-get update
sudo apt-get install pgloader-ccl

Setup DB:

No Format
apt-get install -y postgresql postgresql-contrib libpq-dev
su - postgres
createuser -P -d openproject
createdb -O openproject openproject
exit

DB URL Setup:

No Format
openproject config:set MYSQL_DATABASE_URL="$(openproject config:get DATABASE_URL)"
openproject config:get MYSQL_DATABASE_URL
openproject config:set DATABASE_URL="postgresql://openproject:openproject@localhost/openproject" #My need to be URL Encoded
openproject config:get DATABASE_URL

#URL Encode

No Format
openproject run ruby -r cgi -e "puts CGI.escape('your-password-here');"

Migration:

No Format
sudo openproject run /opt/openproject/docker/mysql-to-postgres/bin/migrate-mysql-to-postgres

Remove Old MySQL:

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

ReConfigure:

No Format
openproject reconfigure