Odoo Help


How to restore and backup db, all collaterals, and restore via script to fresh server?

Tai Kedzierski
on 10/22/15, 7:46 AM 6,192 views


I am trying to perform a backup-and-restore on a test Odoo installation (currently working with v8), without much success. I want to be able to achieve this workflow:

  1. Take a backup of the entire deployment (single standalone instance)

  2. Install Odoo on a new server / erase Odoo from current server and re-install fresh

  3. Restore the backup file to the new instance using an automation script (Linux, bash)


How to reliably take a full backup of the database, such that in one operation (or multiple, scriptable via bash), I can restore the database, additional file assets, and installed modules to a new server?

I have tried two tacks, neither of which work/fulfil my requirements

A/ Manage Databases

Using the Manage Databases interface, I create a backup of the instance which gives me a backup file --> OK

Then on the new instance I upload the database via the web interface. This does not restore some information, notably the logo file. I suspect it does not add modules either, and it is not automatable in this manner.

What might I have missed, and how would I achieve this on the command line?

I guess the filestore in /var/lib/odoo/.local/share/Odoo/filestore/odoo_test would be relevant, but I looked for a file that matched the image and did not find it

B/ Raw database dump / restore

Using psql I dumped the odoo_test database I had set up

Then on the new instance (no initial setup had been done - going to the web interface prompts me to install fresh) I use psql to restore the same database.

When visiting the web interface again, it still is not aware of the instance - obviously, I would likely need to configure its existence somewhere

I looked for a file corresponding to my odoo_test database, but could not locate any

    root@bas-test:/usr/lib/python2.7/dist-packages/openerp# grep -irl odoo_test

    # yielded nothing

Thank you for any suggestion, pointers




| 5 4 6
Zagreb | Karlovac, Croatia

there is only 10 kind of people the ones that understand binary ... and others

On 10/26/15, 6:58 AM

ll pictures and attachments are stored on file system in odoo8 ( and 9)
Default location of files is : odoo_user/~/.local/share/Odoo.
in that folder you will have 3 subfolders :

- apps ( contains downloaded modules) 
- sessions ( no need to move it.. i t will recreate on new server)
- filestore/bd_name - folder containig all pictures , attachments etc for desired database.

when you restore db on new server, folder under ..filestore/new_db_name should be named same as new created database

nd, if you used pg_dump, you need to create database manualy, with correct owner in order to acces it...hope it helps


Ray Carnes

--Ray Carnes--
| 9 7 9
Keyport, United States
--Ray Carnes--

Senior ERP Analyst

OpenERP 6.1, 7.0; Odoo 8.0, 9.0, 10.0 and 11.0.

Completed Odoo Functional and Technical Training.

Functional Areas:

  • CRM/Sales

  • Inventory

  • Manufacturing

  • Accounting

  • Purchasing

Major Skills:

  • Business Process Reengineering

  • Efficiency Consulting

  • User Needs and GAP Analysis;

  • Functional and Technical Design;

  • Prototyping and Proof of Concepts;

  • Requirements Specifications;

  • Agile Implementation;

  • Data Migration;

  • Configuration & Customization (UI and code);

  • Integration - Odoo and non Odoo Applications and Services;

  • Training and Knowledge Transfer;

  • Go Live Support;

  • Helpdesk;

  • Version Upgrades and Migration.

  • Accounting Expert.

I have over 20 years of experience empowering and enabling users with enterprise information systems that make a real and measurable difference in their ability to proactively manage their businesses and organizations. 

I am a skilled Communicator and I only take the serious things seriously!

Ray Carnes
On 8/31/16, 11:41 AM

A database backup created with Database Manager using the zip (includes filestore) option will create a full database of your system including attachments.

Modules are folders of Python code and XML data, so they are never included in the backup.  Which modules are installed are part of the backup.  Any modules you have installed from the first server need to be available on the second server.

Modules that are downloaded via the App link inside Odoo are copied to the .local/share/Odoo/addons/9.0 folder - so don't forget them - they can be in any addons path on the second server. If you script a database backup via PostgreSQL, you need to remember to also copy the filestore folder to the second server with your script.

You can restore either backup type to another system, but:

1. The system needs to have a compatible build of Odoo.  The same version, at the same build or later.  By build I mean the date you downloaded or pulled the code.  You can't reliably restore a backup to a system with a July build from a system that has an August build.

2. The database should always be 'upgraded' via either the command line (-u all option) or by upgrading the base module from the UI.  I prefer doing this from the command line and watching the log file, as it will tell you about any modules that are not available on the new server.

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 10/22/15, 7:46 AM
Seen: 6192 times
Last updated: 8/26/17, 3:41 AM