Openbravo Cloud System Administration Guide
For security Openbravo Cloud instances are configured to not allow SSH access by password but instead only accepts public key authentication.
When requesting your Openbravo Cloud instance you will have chosen a hostname and will have already provided your SSH public key. It will be already added to the instance for the openbravo user.
From a linux system you can use:
Replace <hostname> with the ones you have chosen on signup.
From windows systems Putty is a well known ssh client.
How to add more public keys
After connecting by ssh you can add more public keys if needed 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:
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
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>
Replace <hostname> with the one chosen on signup.
In windows you can use putty, adding this config to the usual ssh config:
- In the principal window of putty "Session"
- Host Name = <hostname>
- 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
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 openbravo@<hostname>:/var/lib/tomcat/logs/catalina.out . scp openbravo@<hostname>:/var/lib/tomcat/logs/openbravo.log .
Replace <hostname> with the ones chosen on signup.
In windows connect with winscp using your ssh information.
On signup you will have provided the timezone for the server you want to use and it will be preconfigured by Openbravo.
If you need you change the timezone later please contact Openbravo Support.
You can check the current timezone with:
Do not change the timezone of Tomcat or Postgres individually, instead request a timezone change of the server, especially you should never have a different timezone in Postgres and Tomcat
Create your own personal backups
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.
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.3 main.
Check that you will not need any of this data, if no run a backup before the restore..
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.
If there are any 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