Changes between Version 7 and Version 8 of transfer_site_between_servers


Ignore:
Timestamp:
Apr 25, 2013, 7:46:30 PM (11 years ago)
Author:
Joseph
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • transfer_site_between_servers

    v7 v8  
    55To 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.
    66
     7== Check the mail logs for user accounts not checking mail.mayfirst.org ==
     8
     9In order to minimize email access breaking, you can check if any of EXAMPLE.ORG's email accounts are not checking mail.mayfirst.org.  Replace the ALL CAPS portion of this command with the appropriate details.
     10
     11{{{
     12for foo in $(grep EXAMPLE.ORG /etc/postfix/virtual_alias_maps | cut -f2 | grep -v @ | sort | uniq); do echo $foo; zgrep "imapd-ssl: LOGIN, user=$foo" /var/log/mail.log* | egrep -v "240.253.234.209|216.66.23.48" | wc -l; done | tee MEMBER-mail-logins.txt
     13}}}
     14
    715== Create the appropriate items in the Members Control panel ==
     16
     17The scripts below create a new hosting order on the new server, moves all the existing red items to the new hosting order, and creates duplicate copies of all the items on the old server with the status of transfer-limbo.  The old hosting order is renamed with the suffix (temp for host move).  The latter set are to be deleted once the migration is final.
    818
    919The first step is to run the {{{transfer-red-items-to-new-host}}} script from hay.mayfirst.org:
     
    1727su www-data
    1828}}}
    19  * Execute the script (below is a sample transcript)
     29 * Execute the script which asks you to confirm whether you want to run this part of the migration or not.  The confirmations allow you to skip certain steps in case you need to skip them if you run the script more than once.  Below is the transcript of the stesp you'll take with itemized descriptions at each point.
    2030{{{
    21310 hay:~$ cd /usr/local/share/red/ui/sbin/
    22320 hay:~$ ./transfer-red-items-to-new-host
     33}}}
     34 * Enter the domain of the hosting order being moved and you'll see information about the hosting order including the current server.
     35{{{
    2336Please enter the domain name of the hosting order to move? apen.ourpowerbase.net
    2437Hosting Order ID: 1000117
    2538Member: Progressive Tech
    2639Current host: julia.mayfirst.org
     40}}}
     41 * Next enter the fully qualified domain name of the new host
     42{{{
    2743Please enter the full domain name of the new host. ella.mayfirst.org
     44}}}
     45 * Turn the domain TTL down for the final migration.
     46{{{
    2847Crank down time to live for DNS to 300 seconds? [Yn] y
    2948Cranking down time to live for DNS to 300 seconds
     
    4059Pseudo-terminal will not be allocated because stdin is not a terminal.
    4160DNS record updated for advantage.apen.ourpowerbase.net
     61}}}
     62 * Create the new hosting order that points to the old server.  The nomenclature of the script is confusing, but the new hosting order is actually a copy of the old one and will be deleted.  The new hosting order points to the old server.  The old hosting order is updated to point to the new server.
     63{{{
    4264Create new hosting order? [Yn]
    4365Creating new hosting order
    4466New hosting order created (1000145)
    4567Using temp hosting order id: 1000145
     68}}}
     69 * Move all the existing red items to the new hosting order (old server) and change their status to transfer-limbo.
     70{{{
    4671Transfer relevant red items to new host (1000145)? [Yn]
    4772Moving red_items to newly created hosting order and setting as transfer-limbo
    4873Done
     74}}}
     75 * Change the old hosting order (new server) with updated server name.
     76{{{
    4977Update old hosting order with new host value? [Yn]
    5078Updating hosting order with new host (ella.mayfirst.org)
     79}}}
     80 * Duplicate the red items from new hosting order (old server) to the old hosting order (new server)
     81{{{
    5182Create new red_items on new host? [Yn]
    5283Making duplicate red_items on new host
     84}}}
     85 * Validating the new red items will likely produce a lot of errors, particularly email addresses.  When running just validation, you will get errors about how certain items did not validate because the related user account doesn't exist. That's normal because when validating, you don't actually create the user account.  This output could prove unhelpful depending on the size of the hosting order.  Regardless the old hosting order (new server) should be manually checked to make sure that user accounts, email addresses, databases, DNS records, web configuration, etc. don't show any errors.
     86{{{
    5387Would you like to validate new red items? [Yn]
    5488Working on item: 23103 (User Account)
     
    66100You must specify a user account that exists. You entered: opbapen.
    67101Errors on validation:
     102}}}
     103 * Commit the changes to the old hosting order (new server).
     104{{{
    68105Would you like to commit new red items? [Yn]
    69106Working on item: 23103 (User Account)
     
    86123}}}
    87124
    88 Notice the validation errors! You will need to read those carefully. When running just validation, you will get errors about how certain items did not validate because the related user account doesn't exist. That's normal because when validating, you don't actually create the user account. In addition, you might get errors when committing (such as the one above) that reports how a directory doesn't exist yet.
    89 
    90 This script will ask you for the domain name of the hosting order you want to transfer and the name of the new host you want to transfer it to.
    91 
    92 It does a number of steps for you:
    93 
    94  * Cranks down the time to live for the DNS records to 300 seconds
    95  * Creates a new hosting order in the state "transfer-limbo" with the same values as the existing hosting order.
    96  * 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.
    97  * Updates the existing hosting order with the new host.
    98  * Creates a copy of every red item, attaching them to the existing hosting order (and assigning them to the new host).
    99 
    100125When 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.
    101126
    102  == Copy data from the current to the new host ==
     127== Copy data from the current to the new host ==
    103128
    104129Next, copy the data from the current host to the new host.
     
    139164}}}
    140165
    141 This 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.
     166This script will rsync all the data, preserving permissions and ownership, to the new host. Then, it will search for Drupal, Wordpress or CiviCRM databases, and if it finds one, creates it (and the associated usernames) to the new host and then dumps the data. Finally, it will search for crontabs on the current host, re-creating any it finds on the new host.
    142167
    143168You can safely run this script as many times as you like.
     
    158183
    159184 * From the control panel, find the control panel in the state "transfer-limbo". Delete it.
    160  
    161