This documentation is for WSO2 API Manager 1.9.0 View documentation for the latest release.
Page Comparison - Upgrading from the Previous Release (v.63 vs v.64) - API Manager 1.9.0 - WSO2 Documentation

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Stop all running API Manager server instances.
  2. Make sure you backed up all the databases and synapse configs as instructed in step 1 of the previous section.

  3. Download the WSO2 API Manager Migration Client v1.9.X.

  4. Before you run the migration client, open the <APIM_1.9.0_HOME>/repository/conf/datasources/master-datasources.xml file, and set the <username>, and <password> elements of the AM_DB JNDI to that of a user who has permissions to alter tables in the database.

    Tip

    Tip: After you are done running the migration client, you can switch these credentials back to a user with lesser privileges.

    For example,

    Code Block
    <datasource>
            ...
            <definition type="RDBMS">
                <configuration>
                    ...
                    <username>xxxxxx</username>
                    <password>xxxxxx</password>
                    ...
                </configuration>
             </definition>
    </datasource>
  5. If the API Manager is running, restart it for the changes to take effect.
  6. Extract the file you downloaded in the previous step and do the following:
    1. Copy the org.wso2.carbon.apimgt.migrate.client-1.9.X.jar file to <APIM_1.9.0_HOME>/repository/components/dropins. If you use a clustered/distributed API Manager setup, copy the JAR file to all nodes.
    2. Copy the migration-script folder into <APIM_1.9.0_HOME>/. If you use a clustered/distributed API Manager setup, copy the migration-script folder to the node that hosts your database.
  7. If you are not using the MySQL database with the API Manager, change the query inside <APIM_1.9.0_HOME>/migration-scripts/18-19-migration/drop-fk.sql according to your database type. The scripts for each database type are given below:

    Database typeScript
    MySQLNo changes are required as the default drop-fk.sql file already contains the scripts for MySQL.
    H2SELECT DISTINCT constraint_name FROM information_schema.constraints WHERE table_name = 'AM_APP_KEY_DOMAIN_MAPPING';
    ALTER TABLE AM_APP_KEY_DOMAIN_MAPPING DROP CONSTRAINT <temp_key_name>;
    OracleSELECT DISTINCT constraint_name FROM user_cons_columns WHERE table_name = 'AM_APP_KEY_DOMAIN_MAPPING' GROUP BY constraint_name HAVING COUNT(constraint_name) = 1;
    ALTER TABLE AM_APP_KEY_DOMAIN_MAPPING DROP CONSTRAINT <temp_key_name>;
    MS SQL ServerSELECT CONSTRAINT_NAME FROM INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE WHERE TABLE_NAME = 'AM_APP_KEY_DOMAIN_MAPPING' AND COLUMN_NAME='CONSUMER_KEY'; 
    ALTER TABLE AM_APP_KEY_DOMAIN_MAPPING DROP CONSTRAINT <temp_key_name>;
    Postgresql

    SELECT CONSTRAINT_NAME FROM information_schema.constraint_table_usage WHERE TABLE_NAME = 'AM_APP_KEY_DOMAIN_MAPPING';
    ALTER TABLE AM_APP_KEY_DOMAIN_MAPPING DROP CONSTRAINT <temp_key_name>;

  8. Start the API Manager 1.9.0 with the following command-line options to migrate the database, registry and the file system together or separately.

    Warning

    If you have a multitenant API Manager setup, copy the contents from your previous <APIM_HOME>/repository/tenants directory to the same directory in the API Manager 1.9.0 (do not replace the _TokenAPI_.xml_RevokeAPI_.xml and _AuthorizeAPI_.xml files in the /default/api sub directory) before you start the server with the following commands.

    DescriptionCommand
    To migrate the database, registry and file system together, at the same time. Ideally, you use this to migrate a standalone pack.-Dmigrate=true  -DmigrateToVersion=1.9
    To migrate the database only. This migrates the AM_DB database. Please ensure that the <APIM_PUBLISHER>/repository/conf/datasources/master-datasources.xml file has an entry for AM_DB.-DmigrateDB=true  -DmigrateToVersion=1.9
    To migrate the registry only. This migrates the registry-related resources such as .rxt and swagger definitions.-DmigrateReg=true  -DmigrateToVersion=1.9
    To migrate the file system only. This migrates the synapse config files such as APIs that reside in the file system. Therefore, you must run this command on the Gateway node/s of a distributed APIM setup. -DmigrateFS=true  -DmigrateToVersion=1.9
    Tip

    Tip: Make sure you do not delete any new files added in <APIM_1.9.0or If you get an 'artifact not found' exception

    Tip

    Tip: If you are using a standalone API Manager setup, you can migrate all the resources together with the -Dmigrate=true -DmigrateToVersion=1.9 command, or perform single-resource migrations using the other commands separately. If you execute -Dmigrate=true -DmigrateToVersion=1.9, you do not need to execute the rest of the commands.

    Tip

    Tip: If you are using a clustered/distributed API Manager setup, runwith the following options -DmigrateDB=true -DmigrateReg=true -DmigrateToVersion=1.9 in the API Publisher node and the -DmigrateFS=true  -DmigrateToVersion=1.9 options in the API Gateway node.

    Optionally, to migrate the API stats DB, use the following options when running the API Publisher node: -DmigrateStats=true -DmigrateToVersion=1.9 when running on the API Publisher node.

  9. Log in to the Management Console of the API Manager and select Extensions -> Artifact Types menu.
    Image Added

  10. Click the Delete link associated with the api artifact type. This removes the reference to the old api artifact type, allowing the latest type to be automatically loaded when the server is restarted.
    Image Added
  11. Do the following to re-index the artifacts in the registry:

    1. Rename the <lastAccessTimeLocation> element in the <APIM_1.9.0_HOME>/repository/conf/registry.xml file. If you use a clustered/distributed API Manager setup, change the file in the API Publisher node. For example, change the /_system/local/repository/components/org.wso2.carbon.registry/indexing/lastaccesstime registry path to /_system/local/repository/components/org.wso2.carbon.registry/indexing/lastaccesstime_1

    2. Shut down the API Manager 1.9.0, back up and delete the <APIM_1.9.0_HOME>/solr directory and restart the server.

...