Changes between Initial Version and Version 1 of transfer_site_between_servers


Ignore:
Timestamp:
May 19, 2008, 12:42:35 PM (12 years ago)
Author:
Jamie McClelland
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • transfer_site_between_servers

    v1 v1  
     1= How do I move a hosting order from one server to another server? =
     2
     3This help page is intended for May First/People Link administrators. Root access to the servers in question is required.
     4
     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.
     6
     7== Create the appropriate items in the Members Control panel ==
     8
     9The first step is to run the {{{transfer-red-items-to-new-host}}} script from harry.mayfirst.org:
     10 
     11 * Login as root:
     12{{{
     13ssh root@harry.mayfirst.org
     14}}}
     15 * Become the www-data user (which has the ability to notify hosts of item changes)
     16{{{
     17su www-data
     18}}}
     19 * Execute the script (FIXME: add sample transcript)
     20{{{
     21/usr/local/share/red/scripts/transfer-red-items-to-new-host
     22}}}
     23
     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.
     25
     26It does a number of steps for you:
     27
     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).
     33
     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.
     35
     36 == Copy data from the current to the new host ==
     37
     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):
     39
     40{{{
     41ssh -A root@current.host.org
     42}}}
     43
     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:
     45
     46{{{
     47/usr/local/share/red/scripts/copy-data-to-new-host new.host.org /home/members/mayfirst/sites/mayfirst.org
     48}}}
     49
     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.
     51
     52You can safely run this script as many times as you like.
     53
     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.
     55
     56== Test ==
     57
     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.
     59
     60== Switch ==
     61
     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.
     63
     64== Clean up ==
     65
     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:
     67
     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
     73