Changes between Version 14 and Version 15 of Petascope_9.5


Ignore:
Timestamp:
Jul 3, 2017 11:47:25 AM (4 weeks ago)
Author:
bphamhuu
Comment:

add the description for how migration script will work

Legend:

Unmodified
Added
Removed
Modified
  • Petascope_9.5

    v14 v15  
    4444
    4545
     46Before version 9.5, update_petascopedb.sh is a script to update old petascopedb in Postgresql with some changes, such as: add some columns, tables, triggers, functions,...Every change in petascopedb was marked as a update version (current version is .17). This script cannot rollback to previous version of petascopedb (e.g: version .17 to version .8). This script has a big disadvantage is: it can only run and update to Postgresql as the SQL syntax are different from every Relational Database.
     47
     48Therefore, in new Petascope with using Hibernate as ORM data model, we cannot add the SQL queries explicitly anymore. To support different kinds of Relation Database, we use the Liquibase which could create the changes for each version to XML and later on generated to target SQL syntax of the current database (e.g: Postgresql, MySql, HSQL,...). There is a migration table is added in new Petascope database to lock the application when the process is running (i.e: no multiple migrations are doing at the same time).
     49
     50We will make a small Java Application to migrate from  old petascopedb to petascopedb_cis. This application also uses Spring and Hibernate and can be invoked from update_petascopedb.sh script (i.e: no expose the service to migrate in new Petascope).
     51
     52Below are the description of the migration from old database to new database:
     53
     54NOTE: if you are using an embedded Database like HSQLDB, H2,... which does not support multiple connections from different application, you will need to stop the current running Petascope (either Tomcat external or embedded) first.
     55
     56* User execute the update_petascopedb.sh script by:
     57{{{
     58./update_petascopedb.sh
     59}}}
     60* All the imported coverages in old petascopedb will be read by old CoverageMetadata model which is imported to new Petascope as a legacy package.
     61* The migration process will check if coverage id exists in new petascopedb_cis. If it does not, a process to translate from old CoverageMetadata model to CIS Coverage data model is done and then persist this new object to new database.
     62* While running the migration, all the services to the new Petascope web application, such as: WCS, WCPS, WMS, WCST will not available to make sure data is migrated safely.
     63
     64NOTE: The old database is kept after the migration as if new Petascope might not work correctly, then user can switch back to old Petascope and old petascopedb.
     65This could be done because, in version 9.5, old petascope deployed in old Tomcat will be renamed from rasdaman.war to rasdaman.war.bak, the petascope.properties is already backuped to petascope.properties.DATE.bak by update_properties.sh script. Then, user can rollback to use the old Petacope without any problem, just by renaming the new Petascope (rasdaman.war, petascope.properties to rasdaman.war.new and petascope.properties.new), then unrename the old ones (rasdaman.war.bak and petascope.properties.DATE.bak).
     66
     67
    4668= List of tested databases [=#list_jdbc]
    4769