This question has been flagged
1 Reply
12731 Views

By default pg_dump will take a backup of a database without its Filestore.

I know there is an option to include Filestore while taking the backup, just like the way it happens in Odoo Manager backup option, but unable to find the right command for the same.

However when I ran a help command of pg_dump, I was unable to find filestore option, what am I missing, So if anyone has executed a backup command, i.e pg-dump with Filestore in Terminal Command, please let me know.


Still better, if it can be achieved in Backup -Script, my script which outputs in GZip format is as follows

pg_dump -h [Host] --port [PORT] -U [USER] -w [DATABASENAME] | gzip > [BACKUP_DIR/BACKFILE.gz]
Avatar
Discard
Best Answer

Hello Deep,

Normally database commands don't give backup of filestore. You have to either take it manually from "/home/odoo_home/.local/Odoo/filestore/db_name" and copy-paste the filestore folders to new database directory.

If you want to see the code, how Odoo takes database backup along with filestore check following link:

Database Backup with Filestore

Edit:

May be auto_backup module can help you. This module has the ability to take the backup of filestores as well.


Hope this will help you.

Sudhir Arya
ERP Harbor Consulting Services
Skype:sudhir@erpharbor.com
Website: http://www.erpharbor.com


Avatar
Discard
Author

Agreed, but when I have a automated Back-script (w/ postgresql) running, which takes the backup every scheduled-time, how can I achieve this. Further manually Copying the filestore for a new-database doesn't sound feasible, so I wonder how to manage this. Or still better is there a way, in Odoo to have a database without the filestore concept? like configuration or so.

Author

Without physical filstore, but let it save those necessary filestore-related files in its database itself. Because this filstore not only stores less/css related files, it also stores attached documents, & my database has provisions to upload a supporting - documents to every-record. So due to the above limitations, I noticed, most of those important documents were corrupted too, including Invoice-Pdf-reports, that gets attached were failed to load in the restored database without its filestore

Deep, in your backup script you can apply the same code which Odoo is using (link I shared in answer).