Content
Migration Debian to Ubuntu 20.04 Database Problems
Added by kak tux almost 4 years ago
Hi there,
I have an openproject installation using Debian 9 and since the repository for that no longer gets updates i wanted to switch to Ubuntu 20.04 (which i use mostly and am most used to).
I am using a virtual machine on a NAS for openproject - so i created a new one with Ubuntu20.04.
Afterwards i followed the guide - logged in to the old installation
https://docs.openproject.org/installation-and-operations/misc/migration/
- Backup - https://docs.openproject.org/installation-and-operations/operation/backing-up/ -> worked fine. It created
- attachments-20210129124631.tar.gz
- conf-20210129124631.tar.gz
- postgresql-dump-20210129124631.pgdump
- Also i copied /etc/openproject to my local drive according to "Moving Configuration" Section of the guide
- "openproject config:get DATABASE_URL" gives "postgresql://openproject:mypassword@localhost/openproject"
On the new installation:
- i followed the installation guide (https://docs.openproject.org/installation-and-operations/installation/packaged/#ubuntu-2004)
- had to install gnupg2 fist to import the key
- Afterwards i did "apt-get install openproject" which went through fine. Now my problems start (having no knowledge of databases).
- copied the 3 backupfiles to /home/myuser
- copied /etc/openproject from local to the new installation - had to add my user to the group openproject + give permissions via chmod to my user to do this
After the guide says "On your new host or cluster, ensure you have created a database user and database, ideally using the same names as the old environment (You may want to choose a different random password, however)." So i tried that - but it seems the tutorials i found were not really the best/didn't work.
Because after "doing (well it doesn't work - so guess i did it wrong)" so
"pg_restore -h localhost -u openproject -W openproject --clean postgresql-dump-20210129124631.pgdump" gives
'"/usr/lib/postgresql/12/bin/pg_restore: invalid option -- 'u' "
I was able to create a user and a database - but it seems the privileges are somehow wrong (e.g. database openproject owner is postgres). Tried to solve this for 6 hours today - no success.
Could you give me a hint to a good tutorial that shows how to create database/password and user? Or if you think this might not be the problem - any hint will be great.