How to apply iDempiere database migration script in windows

Posted on September 10, 2020 · Posted in iDempiere

iDempiere is fully supporting Windows hosting even though there are few servers hosted in windows. Latest sync script written in bash script, we can not use same in windows. But iDempiere database migration script can be applied by an ant tool. Purpose of this blog is to guide for applying iDempiere database migration script in window using ant tool.

When it comes to DB migration in windows, recently not much work done to support migration batch script. But still iDempiere has tools to achieves migration using ant script on windows. Here I would like to mention how this hidden tool used.

Perquisite to perform this steps, you needs to have Apache-ant installed and configured. You can follow steps to do same from Apache ant official page.

How to migrate iDempiere maintenance branch in windows.

iDempiere support latest release for a year and which I am referring as maintenance release. You may like to keep your server up to date if you are hosting

When I am writing this blog,  latest maintained version is 7.1 and so assuming  is to apply it as example.

  1. From migration-history directory, Copy postgresql.properties.template as postgresql.properties for PostgreSQL DB or oracle.properties.template  as oracle.properties for Oracle to migration directory.
  2.  Configure following properties
    1. postgresql.home – Path to PostgreSQL installation
    2. postgresql.database – Database name
    3. postgresql.user – Database user
    4. postgresql.password – PostgreSQL user password
    5. postgresql.host – PostgreSQL server host
    6. postgresql.port – PostgreSQL server port default is 5432

    My Property file looks as below
    #PostgreSQL home folder
    #Example Value:
    # Windows - postgresql.home=C:/pgsql/8.2.13-1<
    # Linux - postgresql.home=/usr/lib/postgresql/8.3
    postgresql.home=C:/Program Files/PostgreSQL/12/
    #PostgreSQL pgdata folder
    #Example Value:
    # Windows - postgresql.pgdata=C:/pgsql/8.2.13-1/data
    # Linux - postgresql.pgdata=/var/lib/postgresql/8.3/main
    postgresql.pgdata=
    #adempiere database name
    postgresql.database=id71t

    #adempiere database login
    postgresql.user=adempiere

    #adempiere database password
    postgresql.password=adempiere

    postgresql.host=localhost
    postgresql.port=5432

  3.  Open command prompt
  4. Change directory to migration\i7.1\postgresql or migration\i7.1\oracle directory.
  5. Run command “ant”apply iDempiere Database Migration Script in windows
  6. Verify that all SQL are success, if any failure, you may needs to fix those migrations manually. Status 0 mean no errors.

 

How to migrate iDempiere from older release to latest in windows 

For example if you want to migrate from 5.1 to 7.1, you needs to apply migration script of 5.1, 5.1z , 6.1, 6.1z,  6.2, 6.2z and 7.1. We don’t have batch automation to achieve this at moment.

Now if you go to migration\i5.1z\postgresql and run ant command, It will throw error “Buildfile: build.xml does not exist!“.

To fix above error, copy build.xml from latest release version to migration script directory which you want to apply. iDempiere maintain build.xml file on maintenance version migration script directory only.

Share Button