Odoo Help


This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


"Permission denied" error when using pg_dump to backup database

on 9/3/14, 9:47 AM 8,309 views


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.


Ben Bernard

--Ben Bernard--
| 4 3 6
Jakarta, Indonesia
--Ben Bernard--
Ben Bernard
On 9/3/14, 10:51 AM

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.

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.

Ludo - Neobis
on 9/3/14, 11:25 AM

@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 ?

on 9/4/14, 4:15 AM

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

on 9/4/14, 4:30 AM
Todd Harrison
On 6/1/16, 6:32 AM

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.


Ludo - Neobis

--Ludo - Neobis--
| 2 2 5
Hoogvliet, Netherlands
--Ludo - Neobis--


Ludo - Neobis
On 9/3/14, 9:57 AM

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?

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.

on 9/3/14, 10:26 AM

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

on 9/4/14, 3:53 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)


Asked: 9/3/14, 9:47 AM
Seen: 8309 times
Last updated: 6/1/16, 6:32 AM