Move Percona Monitoring and Management Server DataPercona Monitoring and Management (PMM2) Server runs as a Docker container, a Virtual appliance, or as an instance on Amazon or Azure cloud services. Here I’ll show how to move the PMM Server and its data from one type to another.

Note, this is only for PMM2 to PMM2—you can’t migrate data from PMM Server version 1 to version 2 because of significant architectural differences.

For this exercise, imagine that your PMM server:

  • Is running on an Amazon EC2 instance (Server A) from an AMI,
  • You want to move it to a dedicated server (Server B) running as a Docker container.
  • Server A monitors one client instance (node1) with a MongoDB service (mongodb1).

Here’s the output of pmm-admin status for this instance.

pmm-admin status

Export Data

PMM2 data is stored in the /srv folder for all types of installations. So first make a backup archive of it.

Copy this archive to Server B.

Prepare New Server

Connect to Server B run all further commands on this server. Prepare the Docker container.

Next extract exported data from the archive.

Create a container for the new PMM Server with a /srv partition on a separate container ( pmm-data).

Stop all services and copy the exported data into the container.

Restore permissions for migrated data folders.

Restart PMM Server so that it reloads files with the correct permissions.

Switch Services to New Server

That’s it! Now you can switch your monitored node1 to use the new server (Server B).

Edit the the PMM agent configuration file /usr/local/percona/pmm2/config/pmm-agent.yaml .

Set the IP address of Server B ( 172.17.0.2 ) and restart pmm-agent.

Check Status

Check the status of pmm-agent and monitored services with pmm-admin status.

Check Status PMM
The agent is now connected to your new server.

In the Grafana UI, you can see the migrated data of Server B. (The time gap in the data is how long it took to run the import and switch node1 to the new server.)

Grafana UI

If historical data is here then we are done. Otherwise, please follow the commands that are provided in the next section.

Export/Import VictoriaMetrics Data

Copy the metrics in the VictoriaMetrics time-series database using an API request for export/import data. (You can do the export remotely and run all further commands on Server B.)

Next import the VictoriaMetrics data.

By default, the maximum allowed size of the client request body for PMM Server’s Nginx service is 10Mb. If exported_data.dump is bigger than this you must increase the limit and repeat the import.

Conclusion

You can use the same process to move from any instance type to another. Also, we have got a separate blog post about how to migrate if the pmm-data container isn’t used. Check it out!

Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments