Odoo Help

Welcome!

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.

1

how to backup a saas database and restore on a local server

By
David Searle
on 8/27/14, 11:58 AM 5,270 views

I have a saas version of openerp and have made a backup of my database from the control centre. This produces a .zip file which extracts to a filestore folder (with sub-folders) and sql file. How can I now restore this to a local version of openerp? Do I use pgadmin as the local "manage database" option looks for a .bak file?

This issue was also raised in https://www.odoo.com/forum/help-1/question/export-setting-and-data-from-odoo-com-to-local-odoo-server-installation-54962 without a satisfactory answer.

 

3
Franz Palfrader
On 9/2/14, 11:20 AM

On the local Server do this

# sudo su odoo (your user)
# dropdb database_name
# createdb database_name
# cd /to/your/dump/path
# psql -f dump.sql database_name

Copy the filestore content, on my server /opt/odoo/.local/share/Odoo/filestore/database_name

 

1
Roberto Barreiro
On 12/3/14, 7:30 AM

If you are working on linux, and if it can be of your interest, I have made 2 scripts, the first to make backup, and the other one to restoring.

The backup script can be combined with cron to make schudeled backups for a default database, or whatever database you want. This backup script creates a compressed backup with a name compound by the database name and the date of the backup. Also it creates (or overwrites) a backup file called yourdb_last_backup, wich is very comfortable to use with the restore script. Using the restore script without parameters, restores the last backup, or you can restore your desired file indicating it as parameter.

Other interesting functions of these scripts are addons backup, and autodelete backups older than the days of your choice.

If you would like to try these scripts contact me. I hope it helps.

Scripts sended. Enjoy them :)

Roberto Barreiro
on 12/3/14, 10:04 AM

Can you please mail me your scripts ekitsikpui5@me.com

Kitsikpui Elliot Elikplim
on 12/4/14, 4:47 AM

if anyone is interested in these scripts, I uploaded them to github: https://github.com/roberto-barreiro/odoo_backup_scripts

Roberto Barreiro
on 4/20/15, 6:34 AM
Thank you. Just when I needed it: )
On Apr 20, 2015, at 10:34 AM, Roberto Barreiro <roberto-disgal.es@mail.odoo.com> wrote:

if anyone is interested in these scripts, I uploaded them to github: https://github.com/roberto-barreiro/odoo_backup_scripts

--
Roberto Barreiro
Sent by Odoo S.A. using Odoo about Forum Post False

Elikplim Elliot Kitsikpui
on 4/20/15, 6:36 AM
1
Yves Goldberg
On 12/2/14, 1:00 PM

DELETED

1
Michael Bos
On 9/3/14, 3:15 AM

You can do what Franz says but you can also do this all in one command.

You dump the database and pipe it directly into another one.

sudo -u postgresql pg_dump -h host1 dbname | psql -h host2 dbname (pg_dump -h host1 dbname | psql -h host2 dbname is taken directly from the PostgreSQL documentation)

So Let's say you have:

host1: openerp.example.com with username openerp

dbname host1: openerp

host2 : local (so leave this blank because it will go for localhost when nothing is mentioned)

dbname host2: whatever you like.

You will use

pg_dump -h openerp.example.nl "dbname" | psql "dbname"

 

Good luck!

 

0
TecDiSol
On 5/7/15, 1:33 PM

How can id do the backup.  

i also don´t know where is  "control centre."



0
Erastus
On 12/21/14, 11:52 AM

Hi Franz how can I get the scripts?
I would like to set it in the crontab.

Regards
Erastus

0
Laurent ROCHE
On 12/21/14, 11:34 AM

@David Searle :

Where do I find the control center ? What is the menu to use ?

I could not find any where a command to export data from the database ! ? !

Any help would be apreciated !

0
Dominique Chabord
On 12/4/14, 12:56 PM

hello,

you have first to ask Odoo about the version running your saas service and build the same.

Then do the restoration of the sql file as explained.

If your server is compatible with the database, you should succeed in starting your server with the --update option and check the log. If this test fails,your server is likely to be uncompatible. For example, it doesn't work with a standard V8.0.

regards

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

6 follower(s)

Stats

Asked: 8/27/14, 11:58 AM
Seen: 5270 times
Last updated: 2/17/16, 2:04 PM