This question has been flagged
3 Replies
12020 Views

Hi, I'm currently running odoo 10 in a docker container. I would like to export the data from the one docker and import it in the other one.

On the source system I do the following:

- export the database: pg_dumpall -U postgres | gzip -c > odoo_backup.out.gz

- copy over the directory /var/lib/odoo


On the target I do:

- import the DB dump: psql -U postgres < odoo_backup.out

- copy the odoo directory back to /var/lib/


All works fine, except that the pictures are not visible. When I edit the website and I want to pick a previously uploaded picture, all are showing errors except for 2.

So I'm wondering now, are the pictures stored in another location as well?


Kind regards,

Gregory

Avatar
Discard
Best Answer

Hi Gregory

Yes, not only the pictures, all the attachments generated and documents are located in the Odoo filestore per database. Normally it's located in the Odoo running user path

~/.local/share/Odoo/filestore

But you could have a different place for that setted in the config file as data_dir of your Odoo like the Odoo Docker Image does

data_dir = /var/lib/odoo

So if you copy the content of /var/lib/odoo maybe you are having some permissions issues. Set the owner for the odoo user again for the copied files just to be sure that Odoo could readit, also check the logs to see what it's the error



Avatar
Discard
Best Answer

For backup, you can go to this link http://localhost:8069/web/database/manager.

  • You can create a backup from there.
  • You can restore your pre existing backup also.

Important- Before that just set your master password for your Database to avoid consequences in future.

If you want to change particular models or fields while logged in. You can do it by export/importaction provided by Odoo. After exporting data from local you can import it on your server for that you have to validate it. 

Avatar
Discard
Best Answer

Hello Gregory,


I' d recommend to use the odoo database backup feature.  That way you can create a backup containing both the database dump as the attachments file store.


Regards,

Avatar
Discard