Skip to Content
Menu
This question has been flagged
12 Replies
20475 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.

 

Avatar
Discard
Best Answer

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

 

Avatar
Discard
Best Answer

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.

Avatar
Discard

Scripts sended. Enjoy them :)

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

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

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

Best Answer

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!

 

Avatar
Discard
Best Answer

DELETED

Avatar
Discard
Best Answer

How can id do the backup.  

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



Avatar
Discard
Best Answer

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

Regards
Erastus

Avatar
Discard
Best Answer

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

Avatar
Discard
Best Answer

@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 !

Avatar
Discard
Related Posts Replies Views Activity
9
Apr 25
62507
9
Jul 24
94118
1
Jul 22
4076
0
Apr 22
50
2
Mar 22
3394