India

ZestyBeanz Technologies Pvt Ltd 4th Floor, Nila, Technopark Thiruvananthapuram,
India – 695581
Phone: +91 471 4063254
Fax : +91 471 2700171

   .

ZestyBeanz Technologies Pvt Ltd
61/3236, Manikkath Cross Road
Ravipuram, Kochi, India - 682016
Phone: +91 484 4063254

  UAE

Zesty Labs
Office # 2003, Millennium Plaza Building
Sheikh Zayed Rd, Dubai, UAE
Phone: +971 4333 2222​
Mobile: +971-52-7553466

  Germany​

ZestyBeanz Technologies GmbH
Reuterstraße 1
90408 Nürnberg
Fon: +49 911 4801 444
Fax: +49 911 4801 445

Contact Form


Hestin Jose's picture

Backup and Restore of complete OpenERP in Linux(Ubuntu)

This is just some simple tips for moving an OpenERP server instance and Database from a Linux server to another Linux physical server. Normally Debain based Ubuntu is recommend to install OpenERP. Hope this will help at least some beginners. Good luck :) This process is normally done using linux commands as mentioned below.

1) On Source Server
.ssh to existing OpenERP server as the user running OpenERP

  • Copy config, binary and init files

demo@openerp:~$ cp /etc/default/demo-server.conf .
demo@openerp:~$ cp /etc/init.d/demo-server .
demo@openerp:~$ cp /usr/bin/demo-server demo-server_bin

  • Backup database

demo@openerp:~$ pg_dump -f OpenERP_devel.tar -F tar -O OpenERP_devel

  • Create an archive with all these files

demo@openerp:~$ tar -czf oerp_backup.tgz *

  • Copy the archive to destination server

demo@openerp:~$ scp oerp_backup.tgz [email protected]:/home/sme_test/

2) On Destination Server

  • Create a new user(this must be done before copiying the backup from source server)

root@ubuntu-test:~# adduser sme_test

  • Create a postgresql user

root@ubuntu-test:~# su postgres
postgres@ubuntu-test:/root$ /usr/lib/postgresql/9.1/bin/createuser -p 5434 sme_test

  • Set password for user

postgres@ubuntu-test:/root$ /usr/lib/postgresql/9.1/bin/psql -p 5434
postgres=# alter user sme_test with password 'smellycat';

  • Switch to new user

root@ubuntu-test:/home/sme_test# su sme_test

  • Change to home directory

sme_test@ubuntu-test:~$ cd

  • Extract the archive

sme_test@ubuntu-test:~$ tar -zxf oerp_backup.tgz

  • Edit config, init and binary files to cope with new system and database user

  • Switch back to root user and create log file

sme_test@ubuntu-test:~$ exit
exit
root@ubuntu-test:/home/sme_test# touch /var/log/sme_test-server.log
root@ubuntu-test:/home/sme_test# chmod 777 /var/log/sme_test-server.log

  • Copy the edited files to appropriate locations

root@ubuntu-test:/home/sme_test# cp demo-server /etc/init.d/sme_test-server
root@ubuntu-test:/home/sme_test# cp demo-server.conf /etc/default/sme_test-server.conf
root@ubuntu-test:/home/sme_test# cp demo-server_bin /usr/bin/sme_test-server

  • Switch user to new OpenERP user, create database and restore database

root@ubuntu-test:/home/sme_test# su sme_test
sme_test@ubuntu-test:~$ /usr/lib/postgresql/9.1/bin/createdb -p 5434 OpenERP_restore
sme_test@ubuntu-test:~$ /usr/lib/postgresql/9.1/bin/pg_restore -p 5434 -d OpenERP_restore -O Dilavie_devel.tar

sme_test@ubuntu-test:~$ exit

  • Start new OpenERP Server

root@ubuntu-test:/home/sme_test# /etc/init.d/sme_test-server start

  • Connect and test

Reply

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. The supported tag styles are: <foo>, [foo], [[foo]]. PHP source code can also be enclosed in <?php ... ?> or <% ... %>.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image. Ignore spaces and be careful about upper and lower case.