Changes between Version 7 and Version 8 of transfer_site_between_servers
- Timestamp:
- Apr 25, 2013, 7:46:30 PM (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
transfer_site_between_servers
v7 v8 5 5 To 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 6 7 == Check the mail logs for user accounts not checking mail.mayfirst.org == 8 9 In 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 {{{ 12 for 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 7 15 == Create the appropriate items in the Members Control panel == 16 17 The 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. 8 18 9 19 The first step is to run the {{{transfer-red-items-to-new-host}}} script from hay.mayfirst.org: … … 17 27 su www-data 18 28 }}} 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. 20 30 {{{ 21 31 0 hay:~$ cd /usr/local/share/red/ui/sbin/ 22 32 0 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 {{{ 23 36 Please enter the domain name of the hosting order to move? apen.ourpowerbase.net 24 37 Hosting Order ID: 1000117 25 38 Member: Progressive Tech 26 39 Current host: julia.mayfirst.org 40 }}} 41 * Next enter the fully qualified domain name of the new host 42 {{{ 27 43 Please enter the full domain name of the new host. ella.mayfirst.org 44 }}} 45 * Turn the domain TTL down for the final migration. 46 {{{ 28 47 Crank down time to live for DNS to 300 seconds? [Yn] y 29 48 Cranking down time to live for DNS to 300 seconds … … 40 59 Pseudo-terminal will not be allocated because stdin is not a terminal. 41 60 DNS 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 {{{ 42 64 Create new hosting order? [Yn] 43 65 Creating new hosting order 44 66 New hosting order created (1000145) 45 67 Using 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 {{{ 46 71 Transfer relevant red items to new host (1000145)? [Yn] 47 72 Moving red_items to newly created hosting order and setting as transfer-limbo 48 73 Done 74 }}} 75 * Change the old hosting order (new server) with updated server name. 76 {{{ 49 77 Update old hosting order with new host value? [Yn] 50 78 Updating 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 {{{ 51 82 Create new red_items on new host? [Yn] 52 83 Making 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 {{{ 53 87 Would you like to validate new red items? [Yn] 54 88 Working on item: 23103 (User Account) … … 66 100 You must specify a user account that exists. You entered: opbapen. 67 101 Errors on validation: 102 }}} 103 * Commit the changes to the old hosting order (new server). 104 {{{ 68 105 Would you like to commit new red items? [Yn] 69 106 Working on item: 23103 (User Account) … … 86 123 }}} 87 124 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 seconds95 * 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 100 125 When 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. 101 126 102 127 == Copy data from the current to the new host == 103 128 104 129 Next, copy the data from the current host to the new host. … … 139 164 }}} 140 165 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 dumpthe data. Finally, it will search for crontabs on the current host, re-creating any it finds on the new host.166 This 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. 142 167 143 168 You can safely run this script as many times as you like. … … 158 183 159 184 * From the control panel, find the control panel in the state "transfer-limbo". Delete it. 160 161