ProxySQL is a high-performance SQL proxy that runs as a daemon watched by a monitoring process. The process monitors the daemon and restarts it in case of a crash to minimize downtime.

The daemon accepts incoming traffic from MySQL clients and forwards it to backend MySQL servers.

The proxy is designed to run continuously without needing to be restarted. Most configurations can be done at runtime using queries similar to SQL statements in the ProxySQL admin interface. These include runtime parameters, server grouping, and traffic-related settings.

In this blog, we are discussing various methods to backup and restore ProxySQL. Below are backup methods to perform a backup restore of the ProxySQL server.

  • Config file backup
  • Mysqldump
  • Physical snapshot

Here will consider ProxySQL configured for async replication with Primary and Replica as shown below in topology.

Config file backup:

ProxySQL backup can be performed by the config file. This method is beneficial in creating multiple instances.

Config backup file can be created by using the below commands and it can be used to start new ProxySQL instances.

Mysqldump:

A ProxySQL backup restore can be performed using mysqldump. It is also possible to dump all (or some) of the tables of ProxySQL’s admin using mysqldump.

mysqldump must be run with –no-tablespaces , –skip-triggers, –skip-add-locks, and –skip-column-statistics

Backup:

Restoration:

If mysqldump version 8.0 is used:

  • mysqldump also needs the –skip-column-statistics option
  • It only works from ProxySQL version 2.0.8 and above

Physical snapshot:

A ProxySQL backup can be performed using the physical snapshot method. Ensure to stop ProxySQL services to get a consistent backup. This method contains the following steps:

  • Stop ProxySQL
  • Create a copy of the data directory
  • Start ProxySQL

Backup:

Restoration:

Conclusion

These methods provide solutions for ProxySQL backups and restores, which play a pivotal role in safeguarding the integrity of your data and providing defense against various disasters, hardware malfunctions, data loss, and corruption. Without reliable backups, the consequences of data loss can be severe, as businesses risk operational disruptions, financial losses, damage to their reputation, and could even result in compliance violations. 

If you are interested in more hands-on learning of ProxySQL, Percona’s professional training department offers a one-day, hands-on intensive tutorial covering all things ProxySQL. In the tutorial, we cover the basics of installation and configuration, read-write splitting, async/GR/PXC-based high availability, query firewalling, query whitelisting, results caching, and much, much more. Reach out to us today to schedule your instructor-led class!

Learn more about Percona Training

Related links:

Download ProxySQL

How to Install ProxySQL From the Percona Repository

Install Percona Server for MySQL

How to set up a replica for replication in 6 simple steps with Percona XtraBackup

Percona MySQL training pdf

Subscribe
Notify of
guest

1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Szymon Skorupinski

Hello,

be aware that SELECT CONFIG INTO OUTFILE is missing fast query rules data – I have just opened bug for this: https://github.com/sysown/proxysql/issues/4445.