Apiman Migration Guide

Notes for upgrading to newer versions of Apiman.

Migrating to 2.1.0.Final

If upgrading to Apiman 2.1.0.Final from a prior version.

Manual action required

Fixing pre-2.1.0.Final Apiman export files

In older versions of Apiman Manager export files were missing their Api Definition schemas (Swagger, OpenAPI, etc).

We have provided a migration assistant CLI tool in order to fix this.

  • Download an Apiman distro (e.g. Tomcat, Wildfly).

  • In the apiman folder you will find a file called migration-assistant-cli.jar.

  • You can run the tool as follows. Note that it should be run against the older/existing installation (i.e. pre-2.1.0.Final):

$ java -jar migration-assistant-cli.jar export upgrade \
  --username=admin (1)
  --password=admin123! (2)
  --endpoint=http://localhost:8080/apiman (3)
  --output=/home/myuser/fixed-export.json (4)
  --trust-all (5)

# or use it directly as a docker container
$ docker run --rm -it ghcr.io/ghcr.io/apiman/migration-assistant export upgrade <...>
1 An Apiman user with administrator privileges.
2 Password.
3 Apiman Manager API endpoint of your old version of Apiman, often this is your bound hostname followed by /apiman.
4 Where to write the enriched export JSON.
5 Whether to trust all certificates and hostnames (when using TLS).

This initial version of the migration assistant tool does nothing other than this enrichment operation.

Once the operation is completed, you can import the file into Apiman 2.1.0.Final and the API definitions will be present.

Elasticsearch

If you are using Elasticsearch for the Apiman Manager API backend and/or metrics, the following sections are important to pay close attention to.

Over time, it has become increasingly more difficult to maintain backwards compatibility between different versions of Elasticsearch due to frequent changes to all aspects of the database in the upstream (schemas, types, etc).

Please pay close attention to the instructions, as Elasticsearch can be very selective which versions work properly during an upgrade process.

Consider backing up your data before taking any action.

Discarding Metrics (5.X to 7.X)

This will result in data loss, please ensure this data is not important before dropping any indices.

If the existing metrics are not important for you:

  1. Drop your current 5.X installation completely or delete the indexes:

    1. apiman_metrics

    2. apiman_manager

    3. apiman_gateway

  2. Use the latest 7.X version of Elasticsearch for a fresh start

Keeping Metrics (5.X to 7.X)

Enabling the Elasticsearch xpack features may change the license that you are running Elasticsearch under. Users should perform appropriate due diligence.

If you want to keep your metrics follow the steps:

  1. Make sure you have the latest version of Elasticsearch 5.x (5.6.16). You have to be at least on this version.

  2. Update Elasticsearch 5.6.16 to 6.8.16 with xpack enabled.

  3. Make sure you have installed kibana in the same version (6.8.16 with xpack enabled)

  4. Run the migration assistant as explained here to prepare to update to the required version of Elasticsearch 7.X https://www.elastic.co/guide/en/kibana/6.8/upgrade-assistant.html

  5. Delete the index apiman_manager and apiman_gateway in kibana. Do not delete apiman_metrics

7.X Notes

A bug was introduced in the schema definition in 2.0.0.Final.

If you are already on Elasticsearch 7.X, then make sure you run an export, and drop/reindex the indexes apiman_manager and apiman_gateway.

Metrics should be unaffected.