View source | Discuss this page | Page history | Printable version   

Openbravo On Demand System Administration Guide

Bulbgraph.png   This document refers to a service that has been discontinued. Please check the Openbravo Cloud service


SSH access

After registering in On Demand you will receive an email with the credential of the Openbravo On Demand management console. Inside it you can find the information for SSH / SFTP access to your Openbravo On Demand instance.

From a linux system you can use:

ssh openbravo@<hostname> -p <your_ssh_port>

Replace <hostname> and <your_ssh_port> with the ones provided in mail, and use the password when prompted.

From windows systems Putty is a well known ssh client.

How to add your public key

After connecting by ssh you can add your public key to the .ssh/authorized_keys file by using any editor like nano or vim.

Paths, where to find what

* Openbravo:   /opt/OpenbravoERP
* Attachments: /opt/OpenbravoERP/attachments
* Logs:        /var/log/openbravo
* Tomcat:      /var/lib/tomcat
* Webapp:      /var/lib/tomcat/webapps/openbravo

How to start, stop postgres and tomcat

First connect by ssh with your user.

For restart tomcat:

sudo /etc/init.d/tomcat stop
sudo /etc/init.d/tomcat start

For restart postgres:

Bulbgraph.png   It should not be necessary at all in normal operation to restart postgres. And in case you need it stop tomcat first.
sudo /etc/init.d/tomcat stop
sudo /etc/init.d/postgresql restart

How to execute ant commands

Go to Openbravo path, by default after login you will be in openbravo folder: /opt/OpenbravoERP.

And there you can execute as usual your ant task

ant ...

All the needed environment variables (CATALINA, ANT, ...) are already preconfigured, there is no need to modify or set any of those.

Connecting to PostgreSQL

Connecting to the database locally

To connect locally to the database you can use the following:

export PGPASSWORD=tad
psql -h localhost -p 5432 -U tad openbravo

Connecting to the database remotely

In order to access the database, you need to create a ssh tunnel.

Then from linux you can open the tunnel with:

ssh -L 5433:localhost:5432 openbravo@<hostname> -p <your_ssh_port>

Replace <hostname> and <your_ssh_port> with the ones provided in mail, and use the password when prompted.

In windows you can use putty, adding this config to the usual ssh config:

  1. In the principal window of putty "Session"
    1. Host Name = <hostname>
    2. Port = <your_ssh_port>
  2. Go to Connection -> Data
    1. Auto-login username = openbravo
  3. Go to Connection -> SSH -> Tunnels
    1. Source port = 5433
    2. Destination field = localhost:5432
    3. Click "Add"
  4. Click on "Open"
  5. The first time you connect you need to accept the fingerprint
  6. It will ask for you ssh user password

Now in your computer in port 5433 it will be available the postgres of your On Demand instance.

You can configure a new connection in your sql program (pgAdmin for example) with:

Downloading a file

To download a file you can use scp or rsync in linux and winscp or filezilla in windows.

For example to download the catalina.out and openbravo log: In linux:

scp -P <your_ssh_port> openbravo@<hostname>:/var/lib/tomcat/logs/catalina.out .
scp -P <your_ssh_port> openbravo@<hostname>:/var/lib/tomcat/logs/openbravo.log .

Replace <hostname> and <your_ssh_port> with the ones that correspond to your Ondemand instance.

In windows connect with winscp using your ssh information.

Change timezone

To see the current time of the server you can use:


You can check the current timezone with:

date +%Z

By default it will be UTC.

Do not change the timezone of Tomcat or Postgres individually, instead change the timezone of the server, especially you should never have a different timezone in Postgres and Tomcat

To change the timezone of the server to a different one:

sudo dpkg-reconfigure tzdata
Bulbgraph.png   CAREFUL !! Changing the Openbravo timezone will affect the dates stored in the db, and this can cause side effects. The best it is to do the change of timezone before start working with Openbravo.

A list of things to check after change the timezone:

Create your own personal backups

Bulbgraph.png   Remember that there is automated daily backups done by the Ondemand platform so in general you can forget about take backups, only use it when you want a backup for a specific reason, for example before an update of openbravo version.

To create a backup:


It will be stored /backups/manual folder.

You can list the manual backups with:

 ls -l /backups/manual

Later, you can restore any of the backups.

Migrate your current Openbravo into On Demand


Before the migration it is high recommended to have a running instance in a consistent state. This means that no local changes should be present in the database and that the application should compile without any issues.

This is recommended as it allows for clear and easy separation of any potential issue during the migration.

Export your current Openbravo

Once you have the Openbravo ready to be migrated, take a backup and move to the new server.

Copy the backup

Connect to the old server:

Then copy the backup from there to the new server:

scp -P <your_ssh_port> /home/openbravo/backup-xxx.tar openbravo@<hostname>:

In rPath appliances: check the path of the backup, or the server in which it is stored. Important the ':' at the end of the previous command

Replace <hostname> and <your_ssh_port> with the ones that correspond to your Ondemand instance

Note: it will ass for your ssh user password.

Then you can connect by ssh to the new server and the backup will be in /home/openbravo folder.

Restore the backup

Check that the application is not in use, and nobody is accessing the database by psql or pgadmin.

The restore will DELETE all the current Openbravo data, this include:

Check that you will not need any of this data, if no run a backup before the restore..

Bulbgraph.png   Since the restore takes sometime and with big databases of some gigabytes the time can be some hours, it is highly recommended to run the restore inside a screen.

Once you are ready you can run the restore as openbravo user with:

openbravo-restore <backup> | tee restore.log

For example: openbravo-restore /backups/auto/backup-20130315-1243-UTC.tar | tee restore.log

Tee will output the log to the console and also will store in the file restore.log.

The restore will decompress the tar-file into temporary folder inside /tmp/ and check the integrity of the files contained (sha1sums).

Then it will stop tomcat and delete the database, if the database is still accessed by someone like an open psql connection, the restore will stop here.

The next it does is the restore of the database. During this if you have an Openbravo older than MP23, the following three harmless warning message are expected and can be safely ignored:

pg_restore: WARNING:  column "delete_btn" has type "unknown"
DETAIL:  Proceeding with relation creation anyway.
pg_restore: WARNING:  column "em_aprm_modif_paym_sched" has type "unknown"
DETAIL:  Proceeding with relation creation anyway.
pg_restore: WARNING:  column "em_aprm_modif_paym_out_sched" has type "unknown"
DETAIL:  Proceeding with relation creation anyway.

If there are any other warnings or errors those should be reviewed, as they may indicate missing data or some other problem preventing a correct and complete restore into the database.

The next step will be delete sources and webapp and restore it with the data from the backup.

The restore script will not start tomcat automatically, so you will need to start it manually:

sudo /etc/init.d/tomcat start

Retrieved from ""

This page has been accessed 16,990 times. This page was last modified on 3 November 2017, at 08:57. Content is available under Creative Commons Attribution-ShareAlike 2.5 Spain License.