Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
4 ตอบกลับ
13153 มุมมอง

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.

Thanks

อวตาร
ละทิ้ง

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

คำตอบที่ดีที่สุด

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.  

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

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.

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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.

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
พ.ค. 16
8279
2
ก.ย. 19
3672
3
มิ.ย. 16
15310
3
พ.ค. 15
9752
DB Restore error message แก้ไขแล้ว
1
มี.ค. 15
9025