Content
You are here:
Migration OP 7.3.2 (Docker) to 7.4.2 (Packaged)
Added by Johann Letzel over 6 years ago
Hi !
We want to migrate our OP running on Docker to a “real” machine.
Source:
OP 7.3.2 with PostgreSQL 9.4 based on Docker
Target:
OP 7.4.2 with PostgreSQL 9.6 installed on CentOS 8 via yum
According to this
https://www.openproject.org/operations/backup/migrating-packaged-installation-environment/
we created a backup from the Docker OP and tried to restore it to the new environment.
But we get the error
pg_restore: [Archivierer (DB)] Fehler in Phase PROCESSING TOC: pg_restore: [Archivierer (DB)] Fehler in Inhaltsverzeichniseintrag 2743; 1259 16392 INDEX unique_schema_migrations openproject pg_restore: [Archivierer (DB)] could not execute query: FEHLER: Index »unique_schema_migrations« existiert nicht Die Anweisung war: DROP INDEX public.unique_schema_migrations;
What is the problem here ? Is it PostgreSQL 9.6 ?
Thanks in advance.
Regards.
Johann Letzel
Replies (4)
Hello Johann,
After trying many times to move my docker container from my desktop to the VPS, that i couldn’t finally do, I decide to migrate my Docker OP 7.3.2 to Packaged OP 7.4.2. And it finally works.
I have followed these steps
1 Create a dump for the database inside the container
$ docker exec -it openproject /bin/bash
(here is were you helped me to get inside the container. Thanks again)
$ su postgres
postgres$ pg_dump -Fc openproject > /tmp/openprojectdb.dump
(inside /tmp postgres user can write)
2 Copy the dump to my server using scp command
3 Install on the server (Ubuntu 16.04) OpenProject Packaged installation following the steps on https://www.openproject.org/download-and-installation/
4 I Stoped before openproject configure
5 Install PostgreSQL 9.4 following the steps on https://www.openproject.org/development/setting-up-development-environment/ for configuring PostgreSQL database.
6 Restore the dump on the server
$su postgres
postgres$ dropdb openproject
postgres$ createdb -T template0 -O openproject openproject
postgres$ \q
$ pg_restore -d openproject /var/backups/openprojectdb.dump
7 Upgrade Postgres from 9.4 to 9.6 following https://www.openproject.org/operations/upgrading/openproject-postgresql-migration-guide-9-6/
8 manual configuration for the PostgreSQL database
$ openproject config:set DATABASE_URL=postgresql://openproject:“password”@127.0.0.1:5432/openproject
9 Openproject configuration wizard skipping MySQL configuration
$ sudo openporject configure
It’s working form me, I hope it helps you
Regards
David.
Hi !
Thanks for that finally we were able to do the trick. I will try to describe it briefely. You use these method at own risk !
Prequsites
Source OP
Docker Container with OpenProject 7.3.2 and PostgreSQL 9.4
Target OP
CentOS with “fresh” and fully configured OpenProject 7.4.2 with PostgreSQL 9.6
Create data dump
opsystem.tar.gz
in your home directoryMigrate data from PostgreSQL 9.4 to 9.6
Connect to container with
docker exec -it pg_migrate /bin/bash
Check if both PG clusters are inactive with
pg_lsclusters
Exit container session with
exit
Copy the dump from host into container with
docker cp opsystem.tar.gz pg_migrate:/
Connect to container with
docker exec -it pg_migrate /bin/bash
Drop old PG 9.4 cluster with
pg_dropcluster 9.4 main --stop
exit
op96.tar
on your hostMigration to OP 7.4
opsystem.tar.gz
andop96.tar
to new server to your home directory (e.g,/home/openproject
)Lucky ending
With a lot kluck you have a running OP 7.4 with you actual data
Hope this help others in future …
Regards.
Hi Johann,
thanks for your elaborate steps for the migration. Can we include this guide in our migration documentation for docker-based installations for 7.4. ?
Best,
Oliver
Hi !
Sorry for the late response.
I would be happy if you these information for your migration guide.
Regards.