Changes between Initial Version and Version 1 of transfer_site_between_servers

May 19, 2008, 12:42:35 PM (12 years ago)
Jamie McClelland



  • transfer_site_between_servers

    v1 v1  
     1= How do I move a hosting order from one server to another server? =
     3This help page is intended for May First/People Link administrators. Root access to the servers in question is required.
     5To help distribute load evenly between our standard servers, it is sometimes necessary to move a hosting order from one server to another. These steps document a process for making a move that allows you to copy and test the move before making a final commitment.
     7== Create the appropriate items in the Members Control panel ==
     9The first step is to run the {{{transfer-red-items-to-new-host}}} script from
     11 * Login as root:
     15 * Become the www-data user (which has the ability to notify hosts of item changes)
     17su www-data
     19 * Execute the script (FIXME: add sample transcript)
     24This script will ask you for the domain name of the hosting order you want to transfer and the name of the host you want to transfer it to.
     26It does a number of steps for you:
     28 * Cranks down the time to live for the DNS records to 300 seconds
     29 * Creates a new hosting order in the state "transfer-limbo" with the same values as the existing hosting order.
     30 * Re-assigns all existing red items to the new transfer-limbo hosting order. These items remain unchanged on the current host (in other words, user accounts, web sites, etc. continue working on the current host). However, they cannot be modified since they are in transfer-limbo.
     31 * Updates the existing hosting order with the new host.
     32 * Creates a copy of every red item, attaching them to the existing hosting order (and assigning them to the new host).
     34When you are done, there will be two hosting orders - one that is in transfer-limbo (and is currently active) and one that is installed on the new target host.
     36 == Copy data from the current to the new host ==
     38Next, copy the data from the current host to the new host by logging into the current host as root (with authentication credentials being forwarded):
     41ssh -A
     44Then, run the {{{copy-data-to-new-host}}} script, passing the target host as the first argument and the path to the hosting order as the second. For example:
     47/usr/local/share/red/scripts/copy-data-to-new-host /home/members/mayfirst/sites/
     50This script will rsync all the data, preserving permissions and ownership, to the new host. Then, it will search for a Drupal database and if it finds one, create it (and the associated username) to the new host and then dump the data. Finally, it will search for crontabs on the current host, re-creating any it finds on the new host.
     52You can safely run this script as many times as you like.
     54Note: the script does not detect databases other than those used by Drupal. If the hosting order is using a non-Drupal database you will need to transfer it by hand.
     56== Test ==
     58The next step is to test. You can test by [wiki:modify_hosts_file modifying your hosts file] so that the domain name used by the site your are moving resolves to the IP address of the new host.
     60== Switch ==
     62If all goes well with the test, you can finalize the move by modifying the DNS records to point the domain name(s) to the IP of the new host. While you are changing the IP records, be sure to change the time to live back to a reasonable number.
     64== Clean up ==
     66Once the transfer has happened, and the site is confirmed to be working and completely intact, you will need to remove the transfer-limbo hosting order:
     68 * From seso, search for the hosting order and click delete. This process will remove all associated red items
     69 * Login to the old host and:
     70  * manually remove any databases associated with the hosting order
     71  * manually remove any crontabs
     72  * remove the hosting order directory