This question has been flagged
1 Reply
3168 Views

Hi all,
I'm using Openerp 7.0 , server : Centos 6.4 . I install Openerp by running "python setup.py install" .
My server is crashed, I have to restore Openerp into the new one. I have openerp.sql dump from postgres.
I install Openerp successfully by following this article : http://rathinavneet.blogspot.com/2013/06/install-openerp-70-on-redhatcent-os-64.html
Then I imported openerp.sql to new server but it hasn't any data.
How can I have my new Openerp with same data as the old one ?

Avatar
Discard
Author

Hi Remya, I dump Postgresql DB by : pg-dump openerp > openerp.sql And openerp.sql is plaintext format. I didn't backup Openerp Installation folder (openerp/addons , conf, modules) , can I restore my Openerp ?

Best Answer

pg_restore is the used for restoring a PostgreSQL database from an archive created by pg_dump in one of the non-plain-text formats. Following is the command with it's options that will restore the database from the binary backup file:
pg_restore -i -h host-name -p port-number -U username -d dbname -a -v "backup-filename.backup"

 

I noticed an interesting point while using pg_restore. pg_restore doesn't work properly if there are referential integrity among the tables on the target database as tables are restored sequentially. So, the best approach to restoring  is first create the tables in the database without enforcing their referential integrity, then run pg_restore. 

Avatar
Discard