Odoo Help

Welcome!

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.

0

"Permission denied" error when using pg_dump to backup database

By
Intasar
on 9/3/14, 9:47 AM 9,129 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.

2

Ben Bernard

--Ben Bernard--
1083
| 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 ?

Intasar
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

Intasar
on 9/4/14, 4:30 AM
0
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.

0

Ludo - Neobis

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

Developer

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.

Intasar
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

vadivel
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)

Stats

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