Charmed MySQL K8s How-to - Migrate DB data using backup/restore

DB data migration using ‘backup/restore’

:information_source: Tip: use ‘mysqldump’ manual to migrate legacy charms data.

This Charmed MySQL K8s operator is able to restore it’s own backups stored on S3-compatible storage. The same restore approach is applicable to restore foreign backups made by different Charmed MySQL installation or even another MySQL charms. The backup have to be created manually using Percona XtraBackup!

:warning: Canonical Data team describes here the general approach and does NOT support nor guaranties the restoration results. Always test migration in LAB before performing it in Production!

Before the data migration check all limitations of the modern Charmed MySQL K8s charm!
Please check your application compatibility with Charmed MySQL K8s before migrating production data from legacy charm!

The approach:

  • retrieve root/admin level credentials from legacy charm. See examples here.
  • install Percona XtraBackup for MySQL inside the old charm OR remotely. Ensure version is compatible with xtrabackup in Charmed MySQL K8s revision you are going to deploy! See examples. BTW, you can use charmed-mysql SNAP/ROCK directly (more details here).
  • configure storage for database backup (local or remote, S3-based is recommended).
  • create a first full logical backup during the off-peak, example of backup command.
  • restore the foreign backup to Charmed MySQL Lab installation.
  • perform all the necessary tests to make sure your application accepted new DB.
  • schedule and perform the final production migration re-using the last steps above.

Do you have questions? Contact us if you are interested in such a data migration!