- Your previous version of Rancher.
During rollback to a prior version of Rancher, you’ll enter a series of commands, filling placeholders with data from your environment. These placeholders are denoted with angled brackets and all capital letters (). Here’s an example of a command with a placeholder:
In this command, <PRIOR_RANCHER_VERSION>
is the version of Rancher you were running before your unsuccessful upgrade. v2.0.5
for example.
Cross reference the image and reference table below to learn how to obtain this placeholder data. Write down or copy this information before starting the procedure below.
Terminal docker ps
Command, Displaying Where to Find <PRIOR_RANCHER_VERSION>
and <RANCHER_CONTAINER_NAME>
You can obtain <PRIOR_RANCHER_VERSION>
and <RANCHER_CONTAINER_NAME>
by logging into your Rancher Server by remote connection and entering the command to view the containers that are running: . You can also view containers that are stopped using a different command: docker ps -a
. Use these commands for help anytime during while creating backups.
Rolling Back Rancher
If you have issues upgrading Rancher, roll it back to its latest known healthy state by pulling the last version you used and then restoring the backup you made before upgrade.
Using a remote Terminal connection, log into the node running your Rancher Server.
Pull the version of Rancher that you were running before upgrade. Replace the
<PRIOR_RANCHER_VERSION>
with that version.For example, if you were running Rancher v2.0.5 before upgrade, pull v2.0.5.
Move the backup tarball that you created during completion of onto your Rancher Server. Change to the directory that you moved it to. Enter
dir
to confirm that it’s there.Run the following command to replace the data in the
rancher-data
container with the data in the backup tarball, replacing the placeholder. Don’t forget to close the quotes.Wait a few moments and then open Rancher in a web browser. Confirm that the rollback succeeded and that your data is restored.
Result: Rancher is rolled back to its version and data state before upgrade.