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.


using commang line pg_dump and pg_restore

Martin Wasala
on 3/27/15, 12:15 PM 1,124 views

Hi guys. I was trying to make a script for making backups in the shell and I shreddered something. Need help now. :)

That´s what I did:

- I made a db backup with pg_dump -Fc

- I renamed the original db in the shell by using psql

- I created a new db with the original name by using createdb in the shell

- restored dumped dbdata into the new db by pg_restore -d

The funny thing was, Odoo was using the old, renamed database, not the new one with the original name.

Now we dropped the old/renamed database and odoo wants us to setup a new database instead of use the new database with the original name. The Database exists and in pgAdmin it looks identically like before that whole operation.

Of course i restarted odoo.


Hi Martin! I've created an Odoo module that automates backups from your Odoo, without technical knowledge. If this could help you have a look at https://www.odoo.com/forum/help-1/question/public-release-automated-backup-module-82374 there are the links to the module and a full guide. Hope this can help you :)

on 3/27/15, 3:04 PM
Kurt Heisel
On 3/27/15, 2:14 PM

Try restoring to a new db name and modifying whatever your start up script is for the new name, also check db ownership vs your script.  

Martin Wasala
On 3/30/15, 4:13 AM

Thanks. The ownership was the problem: psql -U postgres -c "ALTER DATABASE dbname OWNER TO odoo" solved the problem.
Thank you also for listing possibilities for the autobackup. I will check them.



| 5 4 7
Lodz, Poland

On 3/27/15, 1:09 PM

Suggestion, I use to do a backup linux/debian/ubuntu package autopostgresqlbackup. This useful package will give you a copy of the daily, weekly, etc.

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

2 follower(s)


Asked: 3/27/15, 12:15 PM
Seen: 1124 times
Last updated: 3/30/15, 4:13 AM