This topic covers the migration procedure of OpenShift version 2 (v2) applications to OpenShift version 3 (v3).
To migrate OpenShift v2 applications to OKD v3, all cartridges in the v2 application must be recorded as each v2 cartridge is equivalent with a corresponding image or template in OKD v3 and they must be migrated individually. For each cartridge, all dependencies or required packages also must be recorded, as they must be included in the v3 images.
The general migration procedure is:
Back up the v2 application.
Web cartridge: The source code can be backed up to a Git repository such as by pushing to a repository on GitHub.
Database cartridge: The database can be backed up using a dump command (
pg_dump) to back up the database.
Web and database cartridges:
rhcclient tool provides snapshot ability to back up multiple cartridges:
$ rhc snapshot save <app_name>
The snapshot is a tar file that can be unzipped, and its content is application source code and the database dump.
If the application has a database cartridge, create a v3 database application, sync the database dump to the pod of the new v3 database application, then restore the v2 database in the v3 database application with database restore commands.
For a web framework application, edit the application source code to make it v3 compatible. Then, add any dependencies or packages required in appropriate files in the Git repository. Convert v2 environment variables to corresponding v3 environment variables.
Create a v3 application from source (your Git repository) or from a quickstart with your Git URL. Also, add the database service parameters to the new application to link the database application to the web application.
In v2, there is an integrated Git environment and your applications automatically rebuild and restart whenever a change is pushed to your v2 Git repository. In v3, in order to have a build automatically triggered by source code changes pushed to your public Git repository, you must set up a webhook after the initial build in v3 is completed.