Skip to content

Commit

Permalink
Merge branch 'Release-3-0-0-GA' of https://github.com/percona/pmm int…
Browse files Browse the repository at this point in the history
…o Release-3-0-0-GA
  • Loading branch information
catalinaadam committed Jan 23, 2025
2 parents a7e7388 + 3c6cba7 commit c86b0d8
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 51 deletions.
Original file line number Diff line number Diff line change
@@ -1,49 +1,84 @@
# Restore container
# Restore Docker container
You can restore PMM Server either from a manual backup or from an automated backup volume that was created during migration to PMM v3.

!!! caution alert alert-warning "Important"
You must have a [backup](backup_container.md) to restore from.
Before proceeding with restoration, ensure you have either a [manual backup](backup_container.md) or an [automated backup volume](../../../../pmm-upgrade/migrating_from_pmm_2.md#step-2-migrate-pmm-2-server-to-pmm-3) to restore from.

To restore the container:
{.power-number}
=== "Restore from manual backup"
To restore the container from a manual backup:
{.power-number}

1. Stop the container.
1. Stop the container:

```sh
docker stop pmm-server
```
```sh
docker stop pmm-server
```

2. Remove the container.
2. Remove the container:

```sh
docker rm pmm-server
```
```sh
docker rm pmm-server
```

3. Revert to the saved image.
3. Revert to the saved image:

```sh
docker rename pmm-server-backup pmm-server
```
```sh
docker rename pmm-server-backup pmm-server
```

4. Change directory to the backup directory (e.g. `pmm-data-backup`).
4. Change directory to the backup directory (e.g. `pmm-data-backup`):

```sh
cd pmm-data-backup
```
```shc
cd pmm-data-backup
```

5. Copy the data.
5. Copy the data:

```sh
docker run --rm -v $(pwd)/srv:/backup -v pmm-data:/srv -t percona/pmm-server:3 cp -r /backup/* /srv
```
```sh
docker run --rm -v $(pwd)/srv:/backup -v pmm-data:/srv -t percona/pmm-server:3 cp -r /backup/* /srv
```

6. Restore permissions.
6. Restore permissions:

```sh
docker run --rm -v pmm-data:/srv -t percona/pmm-server:3 chown -R pmm:pmm /srv
```
```sh
docker run --rm -v pmm-data:/srv -t percona/pmm-server:3 chown -R pmm:pmm /srv
```

7. Start the image.
7. Start the image:

```sh
docker start pmm-server
```
```sh
docker start pmm-server
```

=== "Restore from automated migration backup"

To restore from an automated backup volume created during [migration to PMM v3](../../../../pmm-upgrade/migrating_from_pmm_2.md#step-2-migrate-pmm-2-server-to-pmm-3):
{.power-number}

1. Stop the current PMM v3 container:
```sh
docker stop pmm-server
```
2. Remove the container (optional):
```sh
docker rm pmm-server
```
3. Start a PMM v2 container using your backup volume, replacing `<backup-volume-name>` with your PMM v2 backup volume name (e.g., `pmm-data-2025-01-16-165135`):

```sh
docker run -d \
-p 443:443 \
--volume <backup-volume-name>:/srv \
--name pmm-server \
--restart always \
percona/pmm-server:2.44.0
```

4. Verify that your PMM v2 instance is running correctly and all your data is accessible.

!!! note alert alert-primary "Finding your backup volume name"
- Your backup volume name was displayed during the [automated upgrade process](../../../../pmm-upgrade/migrating_from_pmm_2.md#step-2-migrate-pmm-2-server-to-pmm-3).
- To list all available Docker volumes, use the following command, and look for volumes with names like `pmm-data-YYYY-MM-DD-HHMMSS`:

```sh
docker volume ls
```
22 changes: 20 additions & 2 deletions documentation/docs/pmm-upgrade/migrating_from_pmm_2.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,35 @@ Before upgrading to PMM 3, ensure your PMM 2 Server is running the latest versio

=== "Automated upgrade (Recommended)"
Use this upgrade script for a simplified migration process:
{ .power-number}

1. Download and run the following script to start the upgrade. The `-b` flag ensures your data is backed up before the upgrade.
1. Download and run the [automated upgrade script](https://raw.githubusercontent.com/percona/pmm/0ad7c05ae253948c779e48ff7976cb5c982af688/get-pmm.sh) to start the upgrade. The `-b` flag creates a backup of your PMM2 instance to ensure that your data is backed up before the upgrade:

```sh
./get-pmm.sh -n <container-name> -b
```
2. Note the backup volume name displayed during the upgrade (e.g., `pmm-data-2025-01-16-165135`) so that you can restore this backup if needed.

2. Check additional script options:
3. Check additional script options:
```sh
./get-pmm.sh -h
```
!!! note alert alert-primary "Restore PMM 2 backup"
If you need to revert to the PMM 2 instance, restore the backup created above:
{ .power-number}


1. Stop the PMM 3 container:
```sh
docker stop pmm-server
```
2. Start a PMM 2 container using the backup volume, replacing `<backup-volume-name>` (e.g., `pmm-data-2025-01-16-165135`) with your actual backup volume name:

```sh
docker run -d -p 443:443 --volume <backup-volume-name>:/srv --name pmm-server --restart always percona/pmm-server:2.44.0
```
3. Verify that your PMM 2 instance is running correctly and all your data is accessible.


=== "Manual upgrade from PMM 2 with Docker volume"

Expand Down
30 changes: 15 additions & 15 deletions documentation/docs/pmm-upgrade/upgrade_docker.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Upgrade PMM Server using Docker
# Manual upgrade: Upgrade PMM Server using Docker

## Before you begin

Expand All @@ -10,7 +10,7 @@ Before starting the upgrade, complete these preparation steps to ensure you can
2. Verify your current PMM version: Check your current PMM version by navigating to **PMM Configuration > Updates** or by running the following command:

```sh
docker exec -it pmm-server curl -ku admin:admin https://localhost:8443/v1/version
docker exec -it pmm-server curl -ku admin:admin https://localhost:8443/v1/version
```

## Upgrade steps
Expand All @@ -21,33 +21,33 @@ Follow these steps to upgrade your PMM Server while preserving your monitoring d
1. Stop the current container:

```sh
docker stop pmm-server
docker stop pmm-server
```

2. [Back up your data](../install-pmm/install-pmm-server/baremetal/docker/backup_container.md).

3. Pull the latest image:

```sh
docker pull percona/pmm-server:3
docker pull percona/pmm-server:3
```

4. Rename the original container:

```sh
docker rename pmm-server pmm-server-old
docker rename pmm-server pmm-server-old
```

5. Run the new container:

```sh
docker run \
--detach \
--restart always \
--publish 443:8443 \
--volumes-from pmm-data \
--name pmm-server \
percona/pmm-server:3
```

6. After upgrading, verify that PMM Server is running correctly and all your data is accessible.
docker run \
--detach \
--restart always \
--publish 443:8443 \
--volumes-from pmm-data \
--name pmm-server \
percona/pmm-server:3
```

6. After upgrading, verify that PMM Server is running correctly and all your data is accessible. You can always [revert to PMM 2](../install-pmm/install-pmm-server/baremetal/docker/restore_container.md) using the backup you created above.
2 changes: 1 addition & 1 deletion documentation/docs/pmm-upgrade/upgrade_podman.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Upgrade PMM Server using Podman
# Manual upgrade: Upgrade PMM Server using Podman

## Before you begin

Expand Down

0 comments on commit c86b0d8

Please sign in to comment.