Skip to main content

Easy Openbravo steps (Duplicating an instance)

Hello world,

You have a remote server with an Openbravo Instance, you need a local clone to start your development, what do you need to do?

Assumptions: process are similar, in this particular case we are using a local pc with Windows/PostgreSQL and the remote server is using a Linux core/PostgreSQL

Steps
0. Connect to the remote server
1. Backup a PostgreSQL database
2. Backup the OB folder
3. Restoring DB

4. Restoring OB 
5. Configuring Openbravo.properties
6. Compiling

0. Connect to the a remote server 

 You need to establish an SSH connection with the remote server, I will be using BitVise for Windows (it provides SSH, an SFTP GUI and Port Forwarding) 



 Add your credentials and remember that some servers need public keys that you need to add. Once logged in, a new terminal will prompt;
 


1. Backup a PostgreSQL database

In our new remote terminal we can execute pg_dump to backup our PostgreSQL database, with default values e.g.
pg_dump -U tad -p 5432 -h localhost -v -f OpenbravoDB_$(date '+%d%m20%y').dmp openbravo

2. Backup the OB folder

You need to find where is the openbravo-erp folder (e.g. find / -name openbravo-erp) and then you can compress the folder, like this:

 tar -hzcf openbravo_$(date '+%d%m20%y').tar.gz openbravo-erp/

It is common to have symbolic links in your modules folder, due to DVCS (e.g. git, mercurial), that's why you should add -h parameter when you are compressing the folder, to include the files of symbolic links.

3. Restoring DB

Open PgAdmin, right click on the Database and select restore:



Then select the dmp file that you create and proceed with the restore.


4. Restoring OB 

You need WinRar or 7Zip to extract the folder, considering Windows has restrinction on the length (path length) try to decompress OB near the drive level, e.g. :

C:\OB\MyInstance1\openbravo-erp



5. Configuring Openbravo.properties

Open the file:
C:\OB\MyInstance1\openbravo-erp\config\Openbravo.properties


 There are parameters that usually you don't need to change, here I mention the ones that you will often change (credentials and locations):

# Absolute path to the attachments directory
attach.path=
C:/OB/MyInstance1/openbravo-erp/attachments
 #Careful, maybe you need to manually create this folder
 #Note that you need / even for Windows systems

# Root sources directory, used by modularity
source.path=
C:/OB/MyInstance1/openbravo-erp/

#Default values
bbdd.rdbms=POSTGRE
bbdd.driver=org.postgresql.Driver
bbdd.url=jdbc:postgresql://localhost:5432
bbdd.sid=aTutorial
bbdd.systemUser=postgres
bbdd.systemPassword=postgres
bbdd.user=tad
bbdd.password=tad
bbdd.sessionConfig=select update_dateFormat('DD-MM-YYYY') 



6. Compiling

Finally, the last step will be to run these ant tasks individually and check the result:

ant update.database -Dforce=yes 
ant compile.complete.deploy
 

This is to make sure that the database records match the modules and lastly to make sure your Java code is working.

Done, now run tomcat and start playing!


Comments

Popular posts from this blog

Crear un .doc desde página php en 5 minutos gratis

Primero descargar esta libreria gratuita: http://phpword.codeplex.com/ Mi ejemplo al final de la página ya la contiene. Descomprimirla donde quieran, lo importante es saber donde quedó el archivo PHPWord.php para después incluirlo en nuestro código con: require_once 'PHPWord.php'; Iniciando el código es:     // Para declarar un nuevo documento     $PHPWord = new PHPWord();     // Para crear seccion para escribir en ella     $section = $PHPWord->createSection(); Luego podemos crear formatos para los textos que introduciremos: // Formatos para los textos       $PHPWord->addFontStyle('rStyle', array('bold'=>true, 'italic'=>false, 'size'=>16));     $PHPWord->addParagraphStyle('pStyle', array('align'=>'both', 'spaceAfter'=>100));     $PHPWord->addFontStyle('estiloTexto', array('bold'=>false, 'italic'=>false, 'size'=>12));     $PHPWord->

Configurar pantalla de inicio de sesión Ubuntu

Configurar pantalla de inicio de sesión Si quieres personalizar el inicio de sesión (pantalla de logeo), puedes instalar un programa llamado Ubuntu Tweak muy intuitivo y que te permite modificar el fondo de la pantalla de logeo entre otras cosas, primero vamos a instalar Ubuntu Tweak: sudo add-apt-repository ppa:tualatrix/ppa  sudo apt-get update  sudo apt-get install ubuntu-tweak  Una vez instalado, al entrar en System Settings deberia aparecerte el icono de Ubuntu Tweak: Luego de darle click a Ubuntu Tweak, dale click a la pestaña de "Tweaks" y a Login Settings: Para modificar la pantalla de Login se requiere permisos de superuser, dale a la opcion de "Unlock" para que puedas realizar cambios: Le das click a la imagen para cambiar el background y al Gtk theme, por ejemplo; mi resultado fue: Espero haber sido de ayuda. Fue hecho en: Ubuntu 12.04

Usando DB2 10.1 desde JAVA en Netbeans en 5 Minutos

Recordemos que usualmente al trabajar con bases de datos y java, existe una API que es el JDBC. En pocas palabras, permite que el código del programa en JAVA haga operaciones SQL sobre la base de datos. (Al final de este articulo pueden ver las definiciones) En DB2 se utilizan 2 tipos de JDBC: Conexión a una fuente de datos utilizando la interfaz DriverManager con el Controlador JDBC de DB2 Universal (db2jcc.java) Conexión de aplicaciones DB2 a una fuente de datos utilizando la interfaz DriverManager con el Controlador JDBC de DB2 de tipo 2 (db2java.zip en Windows) Trabajaremos con el primero (db2jcc.java). Al final dejo un link de las diferencias. Pasos 1. Despues de haber instalado DB2, debemos importar la API JDBC que trae incorporada nuestra base de datos. En donde se haya instalado DB2 comprobar que existe:  ..\IBM\SQLLIB\java\db2jcc.jar En Windows 7 por default: C:\Program Files\IBM\SQLLIB\java\db2jcc.jar 2. Abrir NetBeans (o IDE de preferencia), abrir