Openbravo On Demand System Administration Guide
![]() | This document refers to a service that has been discontinued. Please check the Openbravo Cloud service |
Contents |
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:
![]() | 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:
- In the principal window of putty "Session"
- Host Name = <hostname>
- Port = <your_ssh_port>
- Go to Connection -> Data
- Auto-login username = openbravo
- Go to Connection -> SSH -> Tunnels
- Source port = 5433
- Destination field = localhost:5432
- Click "Add"
- Click on "Open"
- The first time you connect you need to accept the fingerprint
- 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:
- host: localhost
- port: 5433
- user: tad
- password: tad
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:
date
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
![]() | 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:
- The scheduled processes time will be changed, so you need to fix the time of these events.
- In general check the times across all the important flows that you have.
Create your own personal backups
To create a backup:
openbravo-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
Prepare
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.
- Migration from Openbravo Appliance 14.04
- Migration from appliance based on Ubuntu 14.04 to Ondemand is not supported.
- Backup for migrating from Openbravo Appliance 12.04
- ssh -A openbravo@<ip_old_server>
- Take a manual backup: openbravo-backup
- Backup for migration from old Openbravo Appliance (based on rPath)
- Take a backup from the webconsole (http://<IP>:8003).
- Backup for migrate from Ubuntu package
- ssh -A ubuntu@<ip_old_server>
- sudo su - openbravo
- cd $HOME
- wget https://code.openbravo.com/tools/rm/appliances-migration/raw-file/tip/openbravo-migrate-from-ubuntu-package
- chmod +x openbravo-migrate-from-ubuntu-package
- ./openbravo-migrate-from-ubuntu-package
Copy the backup
Connect to the old server:
- For rPath:
- ssh openbravo@<ip_old_server>
- For Ubuntu package:
- ssh ubuntu@<ip_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:
- Sources: /opt/OpenbravERP folder
- Webapp: /var/lib/tomcat/webapp/openbravo folder
- Database: openbravo database in cluster 9.1 main.
Check that you will not need any of this data, if no run a backup before the restore..
![]() | 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