mirror of
https://github.com/rancher/rancher-docs.git
synced 2026-09-25 12:38:05 +00:00
Update backup/restore/rollback procedure
This commit is contained in:
@@ -3,7 +3,7 @@ title: Creating Backups—Single Node Installs
|
||||
weight: 25
|
||||
aliases:
|
||||
- /rancher/v2.x/en/installation/after-installation/single-node-backup-and-restoration/
|
||||
- /rancher/v2.x/en/installation/backups-and-restoration/single-node-backup-and-restoration/
|
||||
- /rancher/v2.x/en/installation/backups-and-restoration/single-node-backup-and-restoration/
|
||||
---
|
||||
|
||||
After completing your single node installation of Rancher create a backup of your current installation. Use this backup as a restoration point in disaster scenarios.
|
||||
@@ -12,26 +12,33 @@ After completing your single node installation of Rancher create a backup of you
|
||||
|
||||
1. Stop the container currently running Rancher Server. Replace `<RANCHER_CONTAINER_ID>` with the ID of your Rancher container.
|
||||
|
||||
```
|
||||
```bash
|
||||
docker stop <RANCHER_CONTAINER_ID>
|
||||
```
|
||||
|
||||
>**Tip:** You can obtain the ID for your Rancher container by entering the following command: `docker ps`.
|
||||
|
||||
2. <a id="backup"></a>Create a backup container. This container backs up the data from your current Rancher Server, which you can use as a recovery point.
|
||||
2. <a id="backup"></a>Create a date container. This container contains the state data from your current Rancher Server, and will be used to start the newer version for Rancher Server.
|
||||
|
||||
- Replace `<RANCHER_CONTAINER_ID>` with the same ID from the previous step.
|
||||
- Replace `<RANCHER_VERSION>` and `<RANCHER_CONTAINER_TAG>` with the version of Rancher that you are currently running, as mentioned in the **Prerequisite** above.
|
||||
|
||||
```
|
||||
```bash
|
||||
docker create --volumes-from <RANCHER_CONTAINER_ID> \
|
||||
--name rancher-backup-<RANCHER_VERSION> rancher/rancher:<RANCHER_CONTAINER_TAG>
|
||||
--name rancher-data-<RANCHER_VERSION> rancher/rancher:<RANCHER_CONTAINER_TAG>
|
||||
```
|
||||
|
||||
3. Backup state the data from the data container. You will need this for disaster recovery or in case you need to rollback the upgrade.
|
||||
```bash
|
||||
docker run --volumes-from rancher-data-<RANCHER_VERSION> -v $PWD:/backup \
|
||||
alpine tar zcvf /backup/rancher-data-backup-<RANCHER_VERSION>.tar.gz /var/lib/rancher
|
||||
|
||||
```
|
||||
|
||||
3. Restart Rancher Server. Replace `<RANCHER_CONTAINER_ID>` with the ID of your Rancher container.
|
||||
|
||||
```
|
||||
```bash
|
||||
docker start <RANCHER_CONTAINER_ID>
|
||||
```
|
||||
|
||||
**Result:** A backup of your Rancher Server is created. If you ever need to restore your backup, see [Restoring Backups: Single Node Installs]({{< baseurl >}}/rancher/v2.x/en/upgrades/restorations/single-node-restoration).
|
||||
**Result:** A backup of your Rancher Server is created. If you ever need to restore your backup, see [Restoring Backups: Single Node Installs]({{< baseurl >}}/rancher/v2.x/en/upgrades/restorations/single-node-restoration).
|
||||
|
||||
@@ -10,15 +10,19 @@ Backup to a restoration point for your Rancher install if you encounter issues w
|
||||
|
||||
1. Stop the container currently running Rancher Server. Replace `<RANCHER_CONTAINER_ID>` with the ID of your Rancher container.
|
||||
|
||||
```
|
||||
```bash
|
||||
docker stop <RANCHER_CONTAINER_ID>
|
||||
```
|
||||
|
||||
1. Launch a new Rancher Server container using the most recent `rancher-backup-<RANCHER_VERSION>` container that you backed up.
|
||||
|
||||
For more information on obtaining this container name, see [Creating Backups—Single Node Installs](/Users/markbishop/Documents/GitHub/docs/content/rancher/v2.x/en/upgrades/backups/single-node-backups/#backup).
|
||||
2. Go to the location where you saved your backup tar balls. And run the following command:
|
||||
```bash
|
||||
docker run --volumes-from <RANCHER_CONTAINER_ID> -v $PWD:/backup alpine sh -c "rm /var/lib/rancher/* -rf && tar zxvf /backup/<BACKUP_FILENAME>.tar.gz"
|
||||
```
|
||||
|
||||
```
|
||||
docker run -d --volumes-from rancher-backup-<RANCHER_VERSION> --restart=unless-stopped \
|
||||
-p 80:80 -p 443:443 rancher/rancher:<CURRENT_RANCHER_VERSION>
|
||||
>**Warning!** Running this command will delete ALL current state data from your Rancher Server container. Any changes that happened after the backup point you are restoring will be lost.
|
||||
|
||||
3. Start you rancher server container back. The container will start with the data from the restored backup.
|
||||
|
||||
```bash
|
||||
docker start <RANCHER_CONTAINER_ID>
|
||||
```
|
||||
|
||||
@@ -3,10 +3,8 @@ title: Rolling Back—Single Node Installs
|
||||
weight: 25
|
||||
---
|
||||
|
||||
Rolling back an unsuccessful Rancher upgrade requires you to run the upgrade command again, with a couple of modifications:
|
||||
|
||||
- Run the upgrade command using the server tag for your prior Rancher install.
|
||||
- Run the upgrade command while pointing toward the backup container you created while completing [Single Node Upgrade]({{< baseurl >}}/rancher/v2.x/en/upgrades/upgrade-scenarios/single-node-upgrade/).
|
||||
Rolling back an unsuccessful Rancher upgrade requires you to
|
||||
restore the backup you created while completing [Single Node Upgrade]({{< baseurl >}}/rancher/v2.x/en/upgrades/upgrade-scenarios/single-node-upgrade/).
|
||||
|
||||
>**Warning!** Rolling back to a previous version of Rancher destroys any changes made to Rancher following the upgrade. Unrecoverable data loss may occur.
|
||||
|
||||
@@ -16,12 +14,21 @@ Rolling back an unsuccessful Rancher upgrade requires you to run the upgrade com
|
||||
docker pull rancher/rancher:<PRIOR_VERSION>
|
||||
```
|
||||
|
||||
1. Launch a Rancher Server container that you created while completing [Step 3 of Single Node Upgrade]({{< baseurl >}}/rancher/v2.x/en/upgrades/upgrade-scenarios/single-node-upgrade/#backup).
|
||||
|
||||
Replace the `<PRIOR_VERSION>` placeholders with the version number of Rancher that you're rolling back to before upgrade.
|
||||
2. Stop the container currently running Rancher Server. Replace `<RANCHER_CONTAINER_ID>` with the ID of your Rancher container.
|
||||
|
||||
```bash
|
||||
docker stop <RANCHER_CONTAINER_ID>
|
||||
```
|
||||
docker run -d --volumes-from rancher-data-snapshot-<PRIOR_VERSION> --restart=unless-stopped \
|
||||
|
||||
3. Go to the location where you saved your backup tar balls. And run the following command.
|
||||
|
||||
```bash
|
||||
docker run --volumes-from rancher-data-<PRIOR_VERSION> -v $PWD:/backup alpine sh -c "rm /var/lib/rancher/* -rf && tar zxvf /backup/<BACKUP_FILENAME>.tar.gz"
|
||||
```
|
||||
|
||||
4. Start a new Rancher Server container with the `<PRIOR_VERSION>` tag.
|
||||
```
|
||||
docker run -d --volumes-from rancher-data-<PRIOR_VERSION> --restart=unless-stopped \
|
||||
-p 80:80 -p 443:443 rancher/rancher:<PRIOR_VERSION>
|
||||
```
|
||||
>**Note:** _Do not_ stop the rollback after initiating it, even if the rollback process seems longer than expected. Stopping the rollback may result in database issues during future upgrades.
|
||||
>**Note:** _Do not_ stop the rollback after initiating it, even if the rollback process seems longer than expected. Stopping the rollback may result in database issues during future upgrades.
|
||||
|
||||
Reference in New Issue
Block a user