Skip to Content
Menu
This question has been flagged
8 Replies
63559 Views

Hello,

I m trying to make backup. i have master password and i double confirm master password from its main configuration file at /etc/openerp-server.conf . Its centos 6.5 final.

When i Try to make backup from its Backup function in "Manage Databases". it shows popup message "Access Denied".

I also try to make backup via command line. here is the output result i got.

 

bash-4.1$  pg_dump -f database1.tar -F tar -O database1
could not change directory to "/root"
pg_dump: [tar archiver] could not open TOC file "database1.tar" for output: Permission denied

OPenerp verision: openerp-7.0-latest

 

EDIT: 4 - SEP - 2014, After helping suggestion i got actual error.

 

pg_dump: server version: 9.2.9; pg_dump version: 8.4.20
pg_dump: aborting because of server version mismatch

How can i fix this issue ?

 

ANy help appreciated.

Avatar
Discard
Best Answer

It looks like your current directory is /root which can't be written by user postgres. Try to execute the same command with the same user in /tmp.

Avatar
Discard

Sharp sight! Alternatively you can make the dump in postgres' home directory (cd ~) when logged in as Postgres user. This directory should always be writeable by user postgres.

Author

@Ben Bernard, You was right. changed directory shows the exact error. pg_dump: server version: 9.2.9; pg_dump version: 8.4.20 pg_dump: aborting because of server version mismatch How can i fix this issue ?

Author

OK, i generate the backup via this command. bash-4.1$ /usr/pgsql-9.2/bin/pg_dump -f database1.tar -F tar -O database1

Best Answer

Just ran into this same issue.  For me, the answer was to chown the owner of the backup destination directory to the PostgreSQL user and group, in my case 'postgres:postgres'.

$> sudo chown -R postgres:postgres /Postres/Odoo/Backups/Directory/

Once that was in place, backups completed successfully.

Avatar
Discard
Best Answer

The system user that you run the comman with, is it in Postgres? Also, does the database you try to dump belong to that user?

Avatar
Discard
Author

Yes, i switched user from root to postgres, i also double checked the owner of the db is postgres. but still can't able to make backup.

login as postgres user and type below command for backup: pg_dump --cluster 9.1/main --format=c database_name > desired_db_name.dump