Backup MySQL 5.1 Restore to MySQL 5.5?

I’m working on setting up a couple of new slaves for replication. We are currently on MySQL 5.1 but we’d like to move to MySQL 5.5 and thought we’d just go the route of setting up 2 new 5.5 slaves and then when we have a maintenance window switch one of the slaves to the master and point our applications to the new master. As I was going through guide on setting up new slaves using XtraBackup it seems as though the data is getting copied at the file level. I’ve been unable to find any direction on restoring this backup to a newer MySQL version. Would this simply be a case of restoring the files and then performing an upgrade on the data then turning on the replication? Any guidance would be greatly appreciated. Thanks!

You are correct, however it is recommended that when upgrading from 5.1 to 5.5 that you export (mysqldump) and re-import your data into the 5.5 instance and then run mysql_upgrade; this is the cleanest method.

If you choose not to go that route, then you would just restore your 5.1 backup as usual using Xtrabackup into the 5.5 instance data directory (making sure to run apply-log and change ownership of the data directory afterwards), and then make sure to run mysql_upgrade once you are done.

Both methods would work.

Once you switch to the new master, make sure none of your old slaves running 5.1 are replicating from the new 5.5 master, as that is not generally recommended (5.1 => 5.5 is okay, 5.5 => 5.1 is not).