As I got some free time today, I decided to move my self-hosted MySQL installation, which is backing this blog and some other stuff too, to a dedicated AWS RDS instance.
Reasoning behind this: The server running this blog is not very beefy (to be precise.. it’s a t2.micro instance; at the time of writing: 1 vCPU and 1 GB RAM) and already ran out of resources from time to time.
The data migration was actually surprisingly easy… after all I do not have any complicated HA setups and fairly small database.
After launching an appropriate AWS RDS instance the migration was performed by executing the below command on the existing host. (With some obvious modifications of course)
mysqldump -u <local_user> \
--databases <database_name> \
-p<local_password> | mysql -u <RDS_user> \
Source: AWS User Guide
Afterwards I created the appropriate db users on the new database instance and granted them permissions to the respective databases.
Now that the migration was finished, all I need to do was reconfigure my services to use the new database instance and users.
After verifying that everything was working correctly, I finally could remove the MySQL installation and gained some additional resources for the remaining services.
Time effort: ~1 hour
Migrated data: ~2 GB
Freed memory: ~250 MB
Let me know, if you have any questions regarding the migration 🙂