1

I am trying to upgrade from greg 5.1.0 to 5.2.0 and am noticing issues with the database.

Following the documented procedures I have connected the new product version with the database of the previous version, downloaded org.wso2.carbon.greg.migrate.client-5.2.0.jar and put it in the dropins folder. From the greg home directory I have navigated to /bin and run wso2server.bat -Dmigrate=5.2.0. Once that is complete I performed the mandatory data migration (wso2server.bat -Dmigrate=5.2.0 -DmigrateProvider=true). Then I re-indexed everything and validated at the recommended checkpoint that IDP_METADATA and SP_METADATA tables do in fact exist. Then I log in to the Store and Publisher and am not seeing my content. I checked the logs and am seeing errors thrown stating OPERATION column does not exist and a few other odd errors. I start investigating the database error below since it is the first error I come to.

ERROR {org.wso2.carbon.identity.application.authentication.framework.store.SessionDataStore} - Error while storing session data {org.wso2.carbon.identity.application.authentication.framework.store.SessionDataStore} com.microsoft.sqlserver.jdbc.SQLServerException: Invalid column name 'OPERATION'.

Looking at the java file I can see where it is running commands agianst IDN_AUTH_SESSION_STORE and OPERATION is one of the fields it is referencing. I look that table up in the database and that field does not exist. That made me wonder if there were any other changes so I run a compare on the 5.1.0 creation script and the 5.2.0 creation script. Based off that compare I can see in 5.1.0 that field does not exist but in 5.2.0 it does. In addition to the new tables mentioned in the procedures and the discrepancy with this error there are also quiet a few more differences between the 2 scripts.

At that point I started to investigate what all was part of the org.wso2.carbon.greg.migrate.client-5.2.0.jar. I locate the Registry Migration Client on github and have no issues finding the source. I can see the migration scripts which add the new tables indicated in the upgrade procedures but I see nothing making any other changes to the database that would bring the 5.1.0 database inline with what is created out of the box with the 5.2.0.

I know 5.2.0 is based on carbon 4.4.5 and 5.1.0 is on 4.4.1 so I check the carbon documentation wondering if maybe this is technically a carbon change and not a greg change but per the carbon documentation there were no database changes upgrading any of the incremental versions from 4.4.1-4.4.5. I would expect that change to be part of the greg upgrade if it was needed but was just trying to be thorough and cover all possibilities I could think of.

I cannot find a database update script, or a step that I missed/misunderstood. Am I missing something or not understanding something in the upgrade procedures?

Joe

Community
  • 1
  • 1
jchaplin
  • 211
  • 1
  • 4
  • 11
  • 1
    You can run the pointed set of queries on the identitty database (https://github.com/wso2/product-is/blob/master/modules/migration/migration-5.0.0_to_5.1.0/scripts/identity/mysql.sql#L142-151), to resolve the above issue. We are yet to complete the migration process.The Documentation will be updated with the identity migrations end to end soon. – Denuwanthi Apr 28 '16 at 13:50
  • (https://docs.wso2.com/display/Governance520/Upgrading+from+a+Previous+Release) Migration Documentation – Denuwanthi Jun 23 '16 at 06:34
  • Thank you Denuwathi. I had not realized in the original question that the migration procedures were not complete. Once the pieces you mentioned were added I was able to successfully perform the install. Thank you for your help. – jchaplin Jun 23 '16 at 12:50

1 Answers1

0

You need to migrate the identity component and user data related component separately before run the

wso2server.bat -Dmigrate=5.2.0

command.

  1. Download the migration client from this URL.
  2. Then copy the MIGRATION_CLIENT_HOME/org.wso2.carbon.is.migrate.client-5.1.0.jar file to the G-REG_HOME/repository/components/dropins/ directory.
  3. Then copy the MIGRATION_CLIENT_HOME/migration-identity-4.5.6_to_5.0.8/ to G-REG_HOME/dbscripts/identity/migration-identity-4.5.6_to_5.0.8/ and MIGRATION_CLIENT_HOME/migration-um-4.5.6_to_5.0.8/ to G-REG_HOME/dbscripts/migration-um-4.5.6_to_5.0.8/
  4. Then navigate to the G-REG_HOME/bin/ directory and execut the below commands to migrate the identity and user data separatly.

    wso2server.bat -Dmigrate -DmigrateIdentity=true -Dcomponent=identity

    wso2server.bat -Dmigrate -DmigrateUMDB=true -Dcomponent=identity

  5. Follow the remaining migration steps as instructed in the WSO2 official documentation in here.

If you open the MIGRATION_CLIENT_HOME/migration-identity-4.5.6_to_5.0.8/mysql.sql script you could see there is a aulter script to add the new coulnm named as OPERATION to the IDN_AUTH_SESSION_STORE table.

ALTER TABLE IDN_AUTH_SESSION_STORE ADD OPERATION VARCHAR(10) NOT NULL;