Best-Practices: Backing up MySQL databases

This article discusses best-practices and considerations when backing up MySQL databases.

Environment

  • MySQL Databases
  • Datto Windows Agent
  • Datto Linux Agent

Description

MySQL is an open source platform available on both Windows and Linux environments. The Datto solution takes an image-based, block-level backup of the protected machine, which you use as an image for restoration.

Windows

MySQL does not have a VSS writer as part of the database. This means that even though the backup is application-aware, the database will be backed up in a crash consistent state. To backup the database it is recommended to either:

  • Stop the database to get a consistent backup, then restart the database after the backup has completed. Backups can be monitored in the Remote Web of the Datto device. With the Datto Windows Agent, you can also watch for the disk to disconnect from the protected machine since its backups are performed with VSS by default. Application aware backups will mount the NTFS volume logged as event id 4 in the Event Viewer and event id 300 for disconnects.

  • Perform backups from within MySQL of the database, and then copy those to a NAS share on the Datto device. If this option is chosen, it may be advised excluding the volume the database sits on from the Datto backups, depending if there is other data on those volumes that need to be backed up.

Linux

The Datto Linux Agent runs quiescing scripts from /etc/datto/dla/pps/, including for MySQL systems. For information on configuring this script, please refer to:

Using Quiescing Scripts with Linux Agents.

Additional Resources