You can back up a server running one MySQL version, and restore on a server running a different MySQL version. After the restore, perform the appropriate upgrade steps as if you were running the new MySQL version for the first time. (Or, if you installed on a server running an older MySQL, perform the appropriate downgrade steps.) For information about upgrading and downgrading after doing the restore, see Upgrading MySQL and Downgrading MySQL.
After upgrading between certain combinations of MySQL versions, you might see error messages about missing or mismatching definitions for system tables. Use the mysql_upgrade command as directed in the upgrade instructions to correct such issues. See mysql_upgrade — Check and Upgrade MySQL Tables for instructions on this command.
Example 5.5 Steps to Back Up on MySQL 5.1 and Restore on MySQL 5.5
Back up on MySQL 5.1.
Install MySQL 5.5.
Restore on MySQL 5.5.
Run upgrade steps as documented in the MySQL reference manual.