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

how can i restore my db


อวตาร
ละทิ้ง

I updated your question for better reach and readability.

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

You can restore the database from Odoo interface (/web/database/manager).

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

video reference here


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

You can restore db using the ODOO interface itself by using the link as mentioned in the above answer or you can do it using psql commands. In the case of large databases I prefer to do with PSQL commands. If you are not a techie, then use /web.database/manager then select your dump and it will restore.

If you need to do some advanced operation, Like restore only perticular tables, or to limit data while restoring,  you need to reorder the loading data or object definitions, or you are dealing compressed formats then using pg_restore functionality is the better option.

Examples:

Plain SQL Format

The plain text format is useful for very small databases with a minimal number of objects but other than that, it should be avoided.

psql -U username -d database -f backupfile.sql

or

psql database < backupfile.sql

Tar Format

Using this archive format allows reordering and/or exclusion of database objects at the time the database is restored. It is also possible to limit which data is reloaded at restore time. we use tar with gzip

pg_restore -d database backupfile.tar -U username

You can add following parameters

  • -c create a new database before restore
  • -v verbose mode
  • - t particular table only

Compressed Format

This is the most flexible format in that it allows the reordering of loading data as well as to object definitions. This format is also compressed by default.

pg_restore -d database backupfile.sql.gz -U username

or

gunzip -c backupfile.sql.gz | psql -U username -d database


Here I explained all in detail:

https://medium.com/@hilarak/odoo-database-backup-automatically-restore-using-psql-7aaf5db89f17


To automate database Backup process use this addon:

https://apps.odoo.com/apps/modules/14.0/auto_backup_odoo/

อวตาร
ละทิ้ง