Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which is the best way to make automated backups?

Tags:

openerp

I'm using openERP v6.1 and I wanted to know which is the best alternative to make automated backups of the DB (let's say daily backups)

The Backup option in the web UI in Manage Databases it's great to restore and create the DB in one step. Of course it has to be done manually. Is there any way to automatize this process and get as results the same kind of backups? (I'm not sure what kind of file it exports as *.dump)

I tried doing pg_dump but I cannot import that file (I tried the raw sql text and gziped) from the web UI, of course must be different formats. And I have some issues trying to import a pg_dump backup to postgres with psql. I can restore the backup but then when access the site in the web, I saw an openERP empty

Any thoughts about best practices to do this?

like image 699
sluc23 Avatar asked Oct 06 '22 22:10

sluc23


1 Answers

Supposing you have access to the server running OpenERP, I recommend using pg_dump (with the "custom" format) via a system level cron task.

Rationale:

  • you'll get finer control over your backup, including if necessary continuous archiving and point in time recovery (see http://www.postgresql.org/docs/9.1/static/backup.html)

  • you won't depend on OpenERP being up and running for the backups to happen. Especially, OpenERP is known for not running its scheduled tasks after restart until a first connection is made to the server, which in some case can be a real pain.

Regarding your "issues trying to import a pg_dump backup to postgres with psql. I can restore the backup but then when access the site in the web, I saw an openERP empty", you'll have to tell us a bit more about the commands you used. I've never had any issues using pg_dump / pg_restore with my OpenERP databases.

like image 146
gurney alex Avatar answered Oct 10 '22 04:10

gurney alex