Help

0

Error on restoring database (Database restore error: Postgres subprocess ('/usr/bin/pg_restore', u'--dbname=restored', '--no-owner', '/tmp/tmpm_lKWR') error 1)

Avatar
Diogo

Impacted versions: 10.0

Steps to reproduce: Export some db from one server then try to import in another server.

Current behavior: returns this error:

Database restore error: Postgres subprocess ('/usr/bin/pg_restore', u'--dbname=restored', '--no-owner', '/tmp/tmpm_lKWR') error 1

Expected behavior: I expect to recover my data in another db, for testing needs

Thanks in advance.

(ps: sorry for the copy/paste from the github issue.. i just need help to solve this ASAP)

1 Comment
Avatar
Discard
Avatar
Anabela
-

Hello, I've the same issue.

In v11 from one server to other server also v11 , if I try to restore the database .zip I get that error, if I try to restore the same database without the filestore(.dump) the restore is completed.

Did you found the solution ?

5 Answers
0

the root cause for this error is mismatch the version of Postgresql

Please make sure the version of Created Database and Version of Postgres that is trying to backup that DB is the same.

if your VPS, hosting machine install many versions postgres, when odoo run psql backup it would take the oldest version to back up, while when you create DB with the db port at version that you want to run, and create DB.


Avatar
Discard
0
Best Answer

My solution, this I did in 2020 to move an instance of Odoo 9 to a virtual machine.

If you do the backup in Postgresql 9.0.23 for example and you want to restore in a Postgresql instance with version 9.3.x it will not allow it, you need to restore from the same version that you made the backup.

You restore by doing:

postgres@Odoo9:/home/administrador$ psql

postgres=# create database my_database;

postgres=# alter database my_database owner to odoo;

postgres@Odoo9:/home/administrador$ psql -U odoo -d my_database -h localhost -f my_database_bak.sql

  


Avatar
Discard
0
Avatar
Axel Mendoza
Best Answer

You could check to see if you have postgresql-client package installed in your OS. That could lead you to those errors

2 Comments
Avatar
Discard
Avatar
Mian Kamran
-

postgresql-client should be installed or not installed?

Avatar
Axel Mendoza
-

it should be installed