Migrating from Compiere

From ADempiere
Revision as of 18:09, 19 October 2008 by Red1 (Talk) (update SVN links)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
This Wiki is read-only for reference purposes to avoid broken links.

Sample case - migrate a customer from Compiere 2.5.2d to Adempiere 3.1.4

Approach 1 - Apply scripts until migrated

Tools

Steps

The objective with this approach is to construct scripts to apply in the customer database until the target release is reached.

First step - Generate migration scripts from 252d to 253a

Currently there are tested migration scripts from 253a to 314, so first step will be to migrate customer from 252d to 253a.

  1. Create customer database
  2. Create Compiere seed from customer version (in the sample Compiere seed 2.5.2d)
  3. Create Compiere 253a seed
  4. Generate schema difference between 252d and 253a databases -> I used TOAD to generate file FromCompiere252dTo253a.sql
  5. Install Karsten migration tool - following steps mentioned in \trunk\migration\src\readme.txt
    1. Follow instructions on eclipse
    2. Change DBDifference.java
      1. private static final String DB1_NAME = "xe";
      2. private static final String DB1_URL -> point to my machine
      3. private static final String DB1_USER = "compiere252d";
      4. private static final String DB1_PASSWD -> my password
      5. private static final String DB2_NAME = "xe";
      6. private static final String DB2_URL -> point to my machine
      7. private static final String DB2_USER = "compiere253a";
      8. private static final String DB2_PASSWD -> my password
      9. private static final String AD_ROLE_ID = null;
      10. private static final String AD_CLIENT_ID = null;
    3. Run Karsten migration tool. Please take account that Karsten migration tool also generate the schema difference to be reviewed (I just use TOAD because I used lots of times and I trust very well the scripts generated with TOAD)
    4. With the output of migration tool save file migrationDictionary252dTo253a.sql

Now we have all the scripts to migrate to 314. Just we need to review carefully every script and analyze/solve the problems.

Second step - Apply scripts

We're ready to apply scripts, they must be applied in customer database in this order:

and so on until the target release is reached

NOTE: Application of every script must be reviewed carefully to analyze/solve errors.

NOTE: You can use this tool to run all scripts in a directory - http://svn.sourceforge.net/viewvc/adempiere/trunk/migration/migrate.sh

Third step - Test with Adempiere 3.1.4

  • Open Adempiere 3.1.4 against the migrated database
  • Run Sequence Check
  • Run Synchronize Terminology (if you use translations)
  • Start testings

Approach 2 - Insert data in fresh installation

The first approach can be difficult because you have many scripts to review/apply. This approach is more straight, because the revision points are fewer.

Tools

Steps

First step - Generate migration scripts from 252d to customer

The first step is to generate a migration script from 252d (customer original seed) vs the customer database. This script is intended to be applied in fresh 314 database.

  1. Create customer database
  2. Create Compiere seed from customer version (in the sample Compiere seed 2.5.2d)
  3. Generate schema difference between 252d and customer databases -> I used TOAD to generate file 02_FromCompiere252dToSource.sql
    1. Karsten migration tool can be used too. Please take account that Karsten migration tool also generate the schema difference to be reviewed (I just use TOAD because I used lots of times and I trust very well the scripts generated with TOAD)

Second step - Generate insert script from customer source to target

You can find the support scripts here: http://svn.sourceforge.net/viewvc/adempiere/trunk/migration/tools_migrate_with_insert/

  1. Create target database - this is a fresh seed of a 314 installation
  2. You need to create first a directory -- CREATE OR REPLACE DIRECTORY dir_tmp AS '/tmp'
  3. And grant to target user permissions -- grant execute on utl_file to target
  4. Then create the procedure generate_insert_as (change dbsource and dbtarget)
  5. Run generate_insert_as - it generates file 04_InsertMigr.sql in the directory created
  6. Follow instructions in 01_pre_migrate
    1. i.e. most customers have pre-installed JasperReports, in this case you must add "AND columnname <> 'JasperReport'" to the where on ad_column and ad_element queries
    2. you must review cases where columnname is changed and edit properly the generated insert statement, i.e. table c_year changed the column year to fiscalyear, the insert as select for c_year must be properly changed to reflect this
    3. please review carefully columns reported in the script as -- columns in target, they must be reviewed if need to be filled and how to fill them
    4. please review carefully columns reported in the script as -- columns in source, they must be reviewed carefully, data can be lost, or maybe they could be renamed

Third step - Apply scripts

We're ready to apply scripts, they must be applied in target (fresh 314) database in this order:

  • Apply 02_FromCompiere252dToSource.sql
  • Apply 03_disconstraints.sql
  • Apply generated and reviewed 04_InsertMigr.sql
  • Apply 05_enaconstraints.sql
  • Execute post_migrate tasks as outlined in 06_post_migrate.sql

Fourth step - Test with Adempiere 3.1.4

  • Open Adempiere 3.1.4 against the migrated database
  • Run Sequence Check
  • Run Synchronize Terminology (if you use translations)
  • Start testings

See Also