Odoo Help


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


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

Tai Kedzierski
on 10/22/15, 7:46 AM 620 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
Greater Los Angeles, United States
--Ray Carnes--

Senior Odoo Analyst

OpenERP 6.1, 7.0 and Odoo 8.0, 9.0 (Since 2012)

Completed Functional and Technical Training.

Major Skills:

  • Needs Discovery and Requirements Analysis;

  • Function and Technical Specifications;

  • Project Planning;

  • Prototyping and Proof of concepts;

  • Data migration;

  • Configuration & Customization (UI and modules);

  • Integration - data, business logic and service levels;

  • Training and Knowledge transfer;

  • Go Live support;

  • Help desk;

  • Version Migration.

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. 

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.

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)


Asked: 10/22/15, 7:46 AM
Seen: 620 times
Last updated: 8/31/16, 11:41 AM