Added by M V over 5 years ago
Hi,
I had OpenProject 8 with MySQL database on Ubuntu 18.04 and everything worked.
Apt source: deb https://dl.packager.io/srv/deb/opf/openproject/stable/10/ubuntu 18.04 main
After upgrade to OpenProject 10 and migration to PostreSQL I cannot backup:
root@server:/# time openproject run backup
* Generating database backup...Error: Invalid data directory
real 0m0.039s
user 0m0.035s
sys 0m0.006s
root@server:/#
At /var/log/openproject I do not see any relevant informations.
How can I fix it?
Backups are very important for me.
Thanks.
Replies (10)
How can I fix it?
This is an error from PostgreSQL that fails to find your database cluster's
datadirectory. How did you migrate to PostgreSQL? Did you use the packaged wizard to install a PostgreSQL database or installed one yourself?Please also append your
/etc/openproject/installer.dat(remove any passwords from it).More information on the error itself:
https://dba.stackexchange.com/questions/209329/psql-gives-invalid-data-directory-error
Best
Oliver
Hi, thanks fo reply.
I did following steps (upgrade from openproject 8 to 9 and after that to 10):
My
/etc/openproject/installer.dat:This means you manually set up the database
openprojectin your postgresql database?Can you connect to it manually outside openproject with
psql postgresql://openproject:secure-password@localhost/openproject"?Best
Oliver
Yes, manually.
Connection works without error:
root@automation-server:/# psql postgresql://openproject:secure-password@localhost/openproject -c "\dt" | head List of relations Schema | Name | Type | Owner -------------+-----------------------------------+-------+------------- openproject | announcements | table | openproject openproject | ar_internal_metadata | table | openproject openproject | attachable_journals | table | openproject openproject | attachment_journals | table | openproject openproject | attachments | table | openproject openproject | attribute_help_texts | table | openproject openproject | auth_sources | table | openprojectThat's weird, we don't do anything special in the backup script:
https://github.com/opf/openproject/blob/dev/packaging/scripts/backup#L14-L19
It's basically just a
pg_dump -Fc $DATABASE_URL > some-path. What happens if you try to run that yourself with the URL above?Best
Oliver
It works without any error.
Curiouser and curiouser! Does your backup target
/var/db/openproject/backupexist and is writable to the openproject user?Best
Oliver
Permissions are ok (I hope).
"openproject run backup" create empty dump file:
I solved i!
There was an error with permission of file
/etc/postgresql/10/main/postgresql.conf. Might be 644, not 600.