Open link in a new tab

Content

Expand project menu

Solved: error in manual. Restoring backup: pg_restore: [archiver] could not open input file #but file exists

Hi,

Just following the manual on backup and restore (which I hope contains the changes after an error incidentally discovered by me a year ago or so).

So here it is what I get on pgdump restoring:

sudo pg_restore --clean --if-exists --dbname $(sudo openproject config:get DATABASE_URL) postgresql-dump-20210412200002.pgdump

pg_restore: [archiver] could not open input file "postgresql-dump-20210412200002.pgdump": No such file or directory

The point is, the file exists there, meaning in

/var/db/openproject/backup

where it should be according to the manual.

So either I am doing something wrong, or the manual is incorrect.

Could anybody help?

Cheers,

Piotr

Message actions

After reinstall postgresql and reconfigure OP, which works now, I still cannot get through this, having a simple output:

sudo openproject config:get DATABASE_URL
postgres://openproject:psswd@127.0.0.1:5432/openproject
user@servername:$ sudo pg_restore --clean --if-exists --dbname $(sudo openproject config:get DATABASE_URL) postgresql-dump-20210412200002.pgdump
pg_restore: [archiver] could not open input file "postgresql-dump-20210412200002.pgdump": No such file or directory

The point is, this file is there:

Hence, I did a test on the clean default OP db: created a "project 1", backed up (yes, backup files exist), removed "project 1", created "project 2", stopped OP from running, no www output,

and then I did

sudo pg_restore --clean --if-exists --dbname $(sudo openproject config:get DATABASE_URL) postgresql-dump-20210419151456.pgdump

which has been recently created.

And the output is the same:

pg_restore: [archiver] could not open input file "postgresql-dump-20210412200002.pgdump": No such file or directory

So, I am happy to tell you that there is a mistake in the manual, the final restore command should be WITH THE PATH, and look like

sudo pg_restore --clean --if-exists --dbname $(sudo openproject config:get DATABASE_URL) /var/db/openproject/backup/postgresql-dump-20210419151456.pgdump

Please change the manual, as it would be life-saver for people with no deep knowledge of dbases and so on.

Maybe advanced admins can understand that but simpletons like myself need the step by step, correct instructions :)

Cheers,

Piotr