How to remove PMM2 volume safely after upgrading to PMM3 version

Hi All,

I have done the upgrade from the PMM2 to the PMM3 version, but after that I can see two volumes: one is with PMM2 and another one is with PMM3. How can I safely remove the PMM2 volume to claim the disk space back?

In the volumes dir, I see two 423GB volumes. I want to remove the old volume (PMM2).
Can someone please help me on this?

[root@tmtpmm102 ~]# docker ps -a
CONTAINER ID   IMAGE                       COMMAND                  CREATED          STATUS                      PORTS                             NAMES
c9edf77920ee   percona/watchtower          "/watchtower --clean…"   24 minutes ago   Up 24 minutes (healthy)     8080/tcp                          watchtower
a669d9d25e5b   percona/pmm-server:3        "/opt/entrypoint.sh"     24 minutes ago   Up 24 minutes (healthy)     8080/tcp, 0.0.0.0:443->8443/tcp   79c904e51ba3
79c904e51ba3   percona/pmm-server:2.44.0   "/opt/entrypoint.sh"     3 hours ago      Exited (0) 24 minutes ago                                     79c904e51ba3-2025-04-08-044601n
9de7345542d3   percona/pmm-server:2.44.0   "/bin/true"              3 hours ago      Created                                                       pmm-data
[root@tmtpmm102 ~]#
[root@tmtpmm102 ~]#
[root@tmtpmm102 ~]#
[root@tmtpmm102 ~]# docker volume ls
DRIVER    VOLUME NAME
local     f5ca340f62f04521824d9d99d4578a26683a45fb980f0a4a2f3a6b5ca4369394
local     f5ca340f62f04521824d9d99d4578a26683a45fb980f0a4a2f3a6b5ca4369394-2025-04-08-044606
local     pmm-data
[root@tmtpmm102 ~]# cd /db/pmmdata/
[root@tmtpmm102 pmmdata]# ls -lrht
total 0
drwxr-xr-x  2 root      root  35 Jun 25  2024 script_jobs
drwxr-xr-x  2 nachandra root   6 Apr  8 02:47 pmm_backup
drwx--x--- 12 root      root 171 Apr  8 04:42 data
[root@tmtpmm102 pmmdata]# cd data/
[root@tmtpmm102 data]# ls -lrht
total 16K
drwx------  4 root root   32 Jul  6  2023 plugins
-rw-------  1 root root   36 Jul  6  2023 engine-id
drwx------  3 root root   22 Jul  6  2023 image
drwxr-x---  3 root root   19 Jul  6  2023 network
drwx------  2 root root    6 Jul  6  2023 swarm
drwx--x--x  4 root root  138 Jul  6  2023 buildkit
drwx------  2 root root    6 Apr  8 04:42 runtimes
drwx------  2 root root    6 Apr  8 04:42 tmp
drwx-----x  5 root root 4.0K Apr  8 04:46 volumes
drwx--x--- 35 root root 4.0K Apr  8 04:56 overlay2
drwx--x---  6 root root 4.0K Apr  8 04:56 containers
[root@tmtpmm102 data]# cd volumes/
[root@tmtpmm102 volumes]# ls -lrht
total 24K
drwx-----x 3 root root     19 Apr  8 02:32 f5ca340f62f04521824d9d99d4578a26683a45fb980f0a4a2f3a6b5ca4369394
drwx-----x 3 root root     19 Apr  8 04:24 pmm-data
brw------- 1 root root 253, 2 Apr  8 04:42 backingFsBlockDev
drwx-----x 3 root root     19 Apr  8 04:46 f5ca340f62f04521824d9d99d4578a26683a45fb980f0a4a2f3a6b5ca4369394-2025-04-08-044606
-rw------- 1 root root    32K Apr  8 04:46 metadata.db
[root@tmtpmm102 volumes]# du -sh *
0       backingFsBlockDev
423G   f5ca340f62f04521824d9d99d4578a26683a45fb980f0a4a2f3a6b5ca4369394
423G   f5ca340f62f04521824d9d99d4578a26683a45fb980f0a4a2f3a6b5ca4369394-2025-04-08-044606
24K     metadata.db
133M    pmm-data
[root@tmtpmm102 volumes]#

Version:

PMM 3.1.0

Can someone help me with the above?

Actually, I tried to remove the below 2.44.0 version container (volume attached) as per the attached screenshot, but unfortunately, it deleted the PMM 3 version container.

79c904e51ba3 percona/pmm-server:2.44.0 “/opt/entrypoint.sh” 9 hours ago Exited (0) 6 hours ago 79c904e51ba3-2025-04-08-044601n

[root@tmtpmm102 ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c9edf77920ee percona/watchtower “/watchtower --clean…” 6 hours ago Up 6 hours (healthy) 8080/tcp watchtower
a669d9d25e5b percona/pmm-server:3 “/opt/entrypoint.sh” 6 hours ago Exited (0) 6 hours ago 79c904e51ba3
79c904e51ba3 percona/pmm-server:2.44.0 “/opt/entrypoint.sh” 9 hours ago Exited (0) 6 hours ago 79c904e51ba3-2025-04-08-044601n
9de7345542d3 percona/pmm-server:2.44.0 “/bin/true” 9 hours ago Created pmm-data
[root@tmtpmm102 ~]# docker volume ls
DRIVER VOLUME NAME
local f5ca340f62f04521824d9d99d4578a26683a45fb980f0a4a2f3a6b5ca4369394
local f5ca340f62f04521824d9d99d4578a26683a45fb980f0a4a2f3a6b5ca4369394-2025-04-08-044606
local pmm-data
[root@tmtpmm102 ~]# docker volume rm 79c904e51ba3-2025-04-08-044601n
Error response from daemon: get 79c904e51ba3-2025-04-08-044601n: no such volume
[root@tmtpmm102 ~]# docker volume rm f5ca340f62f04521824d9d99d4578a26683a45fb980f0a4a2f3a6b5ca4369394-2025-04-08-044606
f5ca340f62f04521824d9d99d4578a26683a45fb980f0a4a2f3a6b5ca4369394-2025-04-08-044606
[root@tmtpmm102 ~]#
[root@tmtpmm102 ~]#
[root@tmtpmm102 ~]#
[root@tmtpmm102 ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c9edf77920ee percona/watchtower “/watchtower --clean…” 6 hours ago Up 6 hours (healthy) 8080/tcp watchtower
a669d9d25e5b percona/pmm-server:3 “/opt/entrypoint.sh” 6 hours ago Exited (0) 6 hours ago 79c904e51ba3
79c904e51ba3 percona/pmm-server:2.44.0 “/opt/entrypoint.sh” 9 hours ago Exited (0) 6 hours ago 79c904e51ba3-2025-04-08-044601n
9de7345542d3 percona/pmm-server:2.44.0 “/bin/true” 9 hours ago Created pmm-data
[root@tmtpmm102 ~]# docker volume ls
DRIVER VOLUME NAME
local f5ca340f62f04521824d9d99d4578a26683a45fb980f0a4a2f3a6b5ca4369394
local pmm-data
[root@tmtpmm102 ~]# docker rm 79c904e51ba3
79c904e51ba3
[root@tmtpmm102 ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c9edf77920ee percona/watchtower “/watchtower --clean…” 6 hours ago Up 6 hours (healthy) 8080/tcp watchtower
79c904e51ba3 percona/pmm-server:2.44.0 “/opt/entrypoint.sh” 9 hours ago Exited (0) 6 hours ago 79c904e51ba3-2025-04-08-044601n
9de7345542d3 percona/pmm-server:2.44.0 “/bin/true” 9 hours ago Created pmm-data
[root@tmtpmm102 ~]#
[root@tmtpmm102 ~]#

After removing the 2.44.0 container and volume.

image

Now the PMM3 container is missing, but actually it should be 2,440 container.

Hi @Naresh9999,
Container name for PMM 3 and container ID for PMM 2 is identical, that’s why it happened.

1 Like

@nurlan But, how can I remove the unused container and volume, even though I have deleted correct container and volume of 2.44.0.

@nurlan
I understand the problem. I entered the container ID rather than the container name when I started the PMM3 update command.

As shown in the screenshot, we must use the container name for the PMM3 upgrade command below.

./get-pmm.sh -n pmm-server -b

1 Like