This article describes the migration of WordPress or other LAMP stack (Linux, Apache, MySQL, PHP) applications from Amazon Web Services (AWS) to the Rackspace Cloud. It takes an estimated 15 minutes to complete, if you follow the instructions step by step.
These steps assume you have provisioned the Rackspace Cloud services your application will require.
The topology of the application in this scenario is presented in the following figure:
After your Cloud Server is set up, install your LAMP stack and application. In this scenario, WordPress is the target application.
sudo apt-get update sudo apt-get install wordpress sudo ln -s /usr/share/wordpress /var/www/wordpress sudo bash /usr/share/doc/wordpress/examples/setup-mysql -n wordpress localhost sudo chown -R www-data /usr/share/wordpress
sudo apt-get install python-novaclient glance-client swift
export ST_USER=<your-login-username> export ST_KEY=<your-API-key> export ST_AUTH=https://identity.api.rackspacecloud.com/v1.0/
You might want to define these variables in .bashrc or .bash_profile, then reload the file with the "source" command.
Retrieve your data from EC2. You can transfer the data directly via rsync or sftp, or you can use the OpenStack Swift client to transfer your data to Cloud Files, and from there transfer to the Cloud Server.
To use Cloud Files, follow these preparatory steps (for this example we'll use an existing container named "WordPress"):
ssh -i your_private_key.pem email@example.com
mysqldump -u<dbusername> -p --triggers --routines --databases wordpress | gzip > ~/staging/db/wordpress.sql.gz sudo tar cvzf ~/staging/app/wordpress.tar.gz /usr/share/wordpress/* sudo tar cvzf ~/staging/app/apachelogs.tar.gz /var/log/apache2/*
swift upload WordPress wordpress.sql.gz swift upload WordPress wordpress.tar.gz swift upload WordPress apachelogs.tar.gz
Note: When you click the Browse button, you can select multiple files.
If you uploaded your data to Cloud Files, transfer it to your Cloud Server with the following steps.
swift download WordPress wordpress.sql.gz gunzip < wordpress.sql.gz | mysql -u <dbusername> -p
sudo service apache2 stop #stop apache server swift download WordPress wordpress.tar.gz # make a backup of your existing wordpress directory sudo tar cvzf wordpress-bak.tar.gz /usr/share/wordpress/*
# restore downloaded WordPress archive
sudo tar xvzf wordpress.tar.gz /usr/share/wordpress
Access your newly migrated WordPress instance by opening a browser and typing:
Before making your migrated application available to the public, we recommend weighing some post-migration considerations like the security of your setup, monitoring its availability, and ensuring your data is regularly backed up.
© 2011-2013 Rackspace US, Inc.
Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License