Roll back a release
If a release of your Optimizely Connect Platform (OCP) app breaks installations, move them back to an earlier release without building or reviewing a new version. A rollback takes up to three commands. Each one shows what it will change and asks before it changes anything.
In this guide, 1.3.0 is the bad release and 1.2.0 is the release to go back to.
This guide applies to release versions, such as 1.2.0. To roll back a preview track, run ocp app rollback. The installations that follow the track move with it. See Roll back a track.
Republish the earlier release
Skip this step if the earlier release is still published. Run ocp app deploy list --app-id my_app to check.
OCP unpublishes a release version automatically when an automatic upgrade leaves it with no installations, so the earlier release is often already unpublished. To republish it, run the following command:
ocp directory publish [email protected]You can republish a release that was unpublished within the last seven days. OCP republishes it from its existing build, without a new review, in every availability region the app is available in. Republishing does not upgrade or downgrade any installation, and it counts against the version limits like any other publish. After seven days, OCP removes the release's environment, and the fix is a new release.
Move the installations off the bad release
Run the following command:
ocp directory upgrade my_app --allFromVersion 1.3.0 -v 1.2.0The CLI checks every availability region the release is published to. Add -a <region> to limit the check to one region. The CLI lists every installation on 1.3.0 that you can access, per region, and asks you to confirm. It then moves the installations one at a time, region by region, and stops at the first failure. To continue with the installations still on 1.3.0, run the command again.
Both versions must have the same MAJOR version. To move a single installation across a MAJOR version, run ocp directory upgrade my_app <trackerId> -v <version>.
Each moved installation runs the upgrade lifecycle of 1.2.0, with fromVersion set to 1.3.0.
Unpublish the bad release
If you no longer need the bad release, run the following command:
ocp directory unpublish [email protected]OCP refuses to unpublish a version while any installation is still on it, including installations in accounts you cannot access. The command targets one availability region at a time (us by default), so run it once per region, for example ocp directory unpublish [email protected] -a eu. The report at the end of the previous step prints the command for each region where nothing is left on 1.3.0.