PLEASE NOTE: This article is intended as a step-by-step process. This guide assumes you are familiar with Linux Server system administration. DO NOT RUN the commands in this article if you do not understand them, or what they do. In all cases make sure that you have backed up your data before you follow the steps in this guide. This process is not intended for US to US migrations. Standard bandwidth charges apply.
Migrating a Cloud Server from the US to the UK using Cloud Files
Now that the Rackspace Cloud is available in the UK, some existing Cloud Servers customers will want to migrate their servers to be hosted from the Rackspace Cloud UK datacenter location. Though this is a complex process, we have created this guide to help you to accomplish this task as painlessly as possible!
IMPORTANT NOTE: US to UK scripted migration is no longer available for older Linux instances hosted on our original XenClassic hypervisors. Please contact support via chat or ticket with the IP addresses of the servers you wish to migrate so we can determine your server's qualification for scripted migration. Otherwise your server can be manually migrated by following the instructions in this article.
If after reading all the instructional guides for this process, you have any questions at all, please review the FAQ or send an email to: CloudMigrations@rackspace.co.uk
This article will walk you through preparing your Cloud Server image to be migrated from the US to the UK, and we will accomplish this by using Cloud Files.
To complete this process, you will:
- Create a UK Cloud Server Account
- Create a new Cloud Server and save an image of it to Cloud Files UK
- Run a database backup, put your database into read-only mode, and save an image of your current US server.
- Install Python and PyYAML
- Download and Run the Migration Script
- Notify Rackspace Cloud Support when migration has completed. Expect response within 1 business day to proceed.
- Create a new Cloud Server in the UK from the US image in Cloud Files.
- Test and evaluate your server, restore database, and adjust DNS if necessary.
- Clean up your US account and remove unnecessary servers.
Create a UK Cloud Account
The first step is to create a UK Cloud Servers account from the UK Control Panel here.
- NOTE: This is a completely separate account from your US account and subject to new account activation. To expedite activation, please reference your US Cloud account username when you are contacted by support. Make sure to note your UK account's API key for later use.
- IMPORTANT: Migrations of server images to the UK cannot be performed if you have already deleted the original server. You may delete the server after the migration has been performed, but not before.
Create a new Cloud Server in the UK Control Panel
Create a new server with the exact same properties (OS, processor type, version, and size) as your US server. For example:
- Linux Cloud server with 1024 MB of RAM running Ubuntu 10.04 LTS (Lucid Lynx)
Create an On-Demand Image - UK
Create an On-Demand image of your new UK Cloud Server and make certain that it has been saved to Cloud Files. Make note of the name that you chose for the On-Demand image for later use. For help with creating an On-Demand image, you can use this Knowledge Base article as a guide.
Prepare Your Server For Migration - US
- Database Applications: If you are running a database application, like MySQL, on your server then take extra care to perform a fresh database backup from your server, and export that data to a secure location for later use.
- Best Practice: Before saving an image of your US server, place your database in read-only mode. Read-Only mode will protect the database from being written to while the image is being saved. This will avoid the chance that your database is writing a commit statement at the time the server image is being made. That could cause data loss when building the new UK Cloud Server from the saved image of your US server. The migration processes are designed to migrate server configuration and other static data, as well as application code: NOT live database data!
- For MySQL Database: To set MySQL to read-only mode; from the command line MySQL client, run the following command:
set global read_only=1;
- Make sure to change this setting back when the server has completed migration by typing from the command line MySQL client:
set global read_only=0;
- The database will not function correctly until it can be written to.
Create an On-Demand Image - US
- Now repeat the On-Demand snapshot process for your US Cloud Server, and make certain that it also has been saved to Cloud Files.
- When naming this image, make sure that it is different from the UK server\rquote s image name in order to avoid confusion. Click here for assistance in creating an On-Demand image, as the process is identical in both the US, and UK Control Panels.
Preparing Your UK Cloud Server to Run the Migration Script
- IMPORTANT NOTE: Server Recommendations for Running Migration Script: Though not specifically required, our testing has shown that the migration process will work faster if you run the script from your new UK server. This should be a new server built from one of the Rackspace Cloud base installation images.
- Note: You will need python 2.6.x or greater for the script to run successfully. We recommend that you use ubuntu 10.10 as the base image Cloud Server to run the migration script if your new server doesn't have Python 2.6 installed (like CentOS 5.5 or RHEL 5.5 and older). Python 2.6 support is available by default on Ubuntu 10.10 and newer.
- If you are running CentOS 5.5 and want to run the script from your server it is possible to install Python 2.6 from a non-standard repository. You can set up the EPEL repository and install Python 2.6 on your server by running the following commands:
sudo rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
sudo yum enablerepo=epel install python26
After the install use the "python26" command instead of "python" when running the script. (advice thanks to William Pape).
Verify That Python is Installed on Your Server
- One of the requirements for running this script is that you have the Python programming language libraries running on your server, this is because the migration script is written in Python. You will also need the PyYAML application installed.
- When you are logged in to your Cloud Server, simply type python from the command line. If the terminal responds with a prompt like this below, then you already have Python installed:
Python 2.6.6 (r266:84292, Dec 26 2010, 22:31:48)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information. >>> exit 'Use Ctrl-D (i.e. EOF) to exit.'
- Otherwise you will need to install Python. Use the following commands:
yum install python
apt-get install python
- For other package managers or distributions, please consult their documentation.
- PyYAML is a data-serializer that will allow Python to work with the human-readable data that you enter into the script.
- Get the PyYAML Gzip Package - From your Cloud Server command line, enter the following:
~]# wget http://pyyaml.org/download/pyyaml/PyYAML-3.09.tar.gz
~]# tar -xvzf PyYAML-3.09.tar.gz
- Finally, run the PyYAML installer:
~]# python setup.py install
and you will see the system return the following:
[hostname PyYAML-3.09]# python setup.py install
Download the Migration Script
- Please note your use of the migration script is subject to the Cloud Terms of Service and for the purposes of the Agreement, the migration script shall be deemed a Beta Service. If you do not feel that you are able to perform these actions, please contact our Customer Care team, who will discuss scheduling a consultation with a migration partner or our Professional Services team. Standard bandwidth charges will apply between the US & the UK networks – it is recommended that you run the script from your UK Cloud Server!
- To download the migration script, save the .zip file available from this link:
- If you like, you can use the Checksums below to verify data integrity of the file:
- Checksum MD5 : aabd14b2c26b9e6880cc19d16c035241
- Checksum SHA1: d6639b95950efa57dc23ab5917606d7480ade33e
- Extract the 2 Python files in the .zip archive to the server that you will be using to run the migration script. Again, we recommend that you run this script from your UK server.
Run the Migration Script
- Now that you have the Python and PyYAML installed on your server, it is time to run the script that will migrate your Cloud Server image from the US to UK Cloud Files.
- From command line, type the following command:
- python ccp.py -i -v US_username:US_api key@cloudservers/image_manifest_file_name.yml UK_username:UK_api_key@cloudservers/
(substitute real values for the underlined values in this example):
- Here is an example of what the script will look like with sample values:
PyYAML-3.09]# python ccp.py -i -v clouduser:123abc456def789ghi012jkl345mno67@cloudservers/testsnapshot_20110215_2111157_cloudserver582527.yml ukclouduser:890pqr123stu456vwx789yza012bcd345efg67@cloudservers/
IMPORTANT NOTE: The image manifest file name is the name of the .yml file for your snapshot that you can see in Cloud Files under the container labeled cloudservers.
Open a Support Ticket
Now that your UK account has been prepared to receive the image of your US Cloud Server, please open a new Support Ticket that includes the following. Please change the values in < > with your details.
- Ticket Subject Line: UK Cloud Server Migration
- Content: I'm performing a US to UK cloud server migration using the migration script. I've copied the US snapshot image over to my UK cloud files, and I'm ready for you to make the image available to my UK cloud server Control Panel so I can restore the image.
- Here's the detail:
- US username: <US cloud username>
- US source cloud server snapshot image name: <image name for the source server in the US>
- US source cloud server snapshot image .yml file: <image manifest file name in the US>
- UK username: <UK cloud username>
- UK destination cloud server snapshot image name: <image name for the destination server in the UK>
- UK destination cloud server snapshot image yml file: <image manifest file name in the UK>
Migration Has Been Performed
- Please wait for our Support teams to respond to your ticket and let you know that your UK saved image has been successfully replaced with the image of your US server. Your request will be processed within 1 business day.
- IMPORTANT NOTE: There may be a small delay before your migrated image appears in the UK Cloud Files. Using the File Manager interface through the Rackspace Cloud UK Control Panel, open the container labeled cloudservers and press the Reload button several times if you do not immediately see your migrated server image.
Build a New UK Cloud Server From US Cloud Server Image
- Build a new UK server from the saved image in Cloud Files UK (which now has your US server image).
- Again, Create a new server with the exact same properties (OS, processor type, version, and size) as your US server. For example:
- When the new server build has completed, your UK server will be an exact copy of your US server, only with a new IP address. For assistance with restoring a Cloud Server from a saved image, please refer to this article.
IMPORTANT NOTE: If your server image is using all, or nearly all, of the allotted disk quota, you may experience a problem restoring your server image to your UK Cloud Server. In a case like this, you may need to restore that server image to a Cloud Server with a larger disk quota.
For example: You are migrating a server with 1 GB of RAM and 40 GB of disk quota, but there is less than 10% free space available on the server. You may need to build the image to a server in the UK that has 2 GB of RAM and 80 GB of disk space. Windows Cloud Servers can scale up, but cannot scale down, so you would need to keep the server image on the larger server and pay the higher hourly rate. You can avoid this problem by cleaning up space on your server (deleting logs, temp directories) before performing the image.
Test and Evaluate
- Please evaluate your server and check for file system integrity and content. Pay special attention to your firewall settings and make sure that all ports are open for required services before putting your UK server into production.
- Database Applications: Now would be the best time to either import your saved DB export file to your new UK Cloud Server, and/or to turn off read-only mode on your database.
- Thoroughly test your DB after restoring it from the saved export file. If no problems are encountered after restoring the database, we strongly advise taking an image snapshot of your Cloud Server to save the successful restoration of your database.
- DNS Changes: At this time, you may also need to make adjustments to your DNS records to reflect the new IP address of your server. Please refer to this article for more information on managing your DNS through the Rackspace Cloud Control Panel.
- Estimated Time to Complete Migration: There are several factors that will impact the length of time required to complete the migration. Depending on the size of your server, and the network traffic at the time the migration script is running, the migration can take in excess of 10 hours. Most migrations will complete within 1-6 hours, but our testing of this process did show some migrations required more than 10 hours to complete.
- Clean Up Your US Account: Once your server has been successfully migrated, you will still be responsible for any Cloud assets (Cloud Servers or Cloud Files) that are on your US account. At this time you may want to delete the original US server that has been migrated. Once deleted, you will no longer be charged for that server. You are not required to delete your Rackspace Cloud US account, but if you wish to do this and avoid further charges, simply delete all Cloud Assets.
- Cloud Server Throughput Limits: This table shows the recently increased networking throughput rate-limits for the public interface on all Cloud Servers:
Rackspace believes the information provided herein is correct as of the date of distribution. However, the information contained in this document is given by Rackspace in good faith only and without any warranties or representations as to the accuracy or completeness of the information. Rackspace expressly excludes all warranties, conditions and other terms implied by law and all liability for losses arising from a customer, partner or third party’s reliance on the information contained in this document. This does not affect our liability for death or personal injury caused by our negligence, nor our liability for fraud or fraudulent misrepresentation, nor any other liability which cannot be excluded or limited under applicable law.