Migrate data via backup/restore¶
Charmed MySQL is able to restore its own backups stored on S3-compatible storage.
The same restore approach is applicable to restore external backups made by a different Charmed MySQL installation, or even another MySQL charm. (Note that, in this case, the backup must be created manually using Percona XtraBackup)
See also
For data stored in legacy charms, see How to migrate data via mysqldump
Prepare¶
Before migrating data:
check all limitations of the modern Charmed MySQL charm
check your application’s compatibility with Charmed MySQL
Migrate via backup/restore¶
The approach described below is a general recommendation, but we cannot guarantee restoration results. Contact us if you have any doubts about data migration/restoration.
And, as always, try it out in a test environment before migrating in production!
Retrieve root/admin level credentials from legacy charm.
Example: Obtain existing database credentials
Install Percona XtraBackup inside the old charm OR remotely.
Ensure the version is compatible with xtrabackup in
Charmed MySQL
revision you are going to deploy. See installation examples.You can also use the
charmed-mysql
snap or rock directly. For more details, see Architecture.
Configure storage for database backup
S3-based is recommended. See Configure S3 for AWS
Create a first full logical backup during the off-peak
Restore the external backup to a Charmed MySQL installation in a test environment
Test your application to make sure it accepted the new database
Schedule and perform the final production migration
Do you have questions? Contact us if you are interested in such a data migration!