Migrating a site from another server: Difference between revisions

From Edgar BV Wiki
Jump to navigation Jump to search
(New page: <pre> # framework rsync cd /home/sites/www.more-in.com/live/ rsync -a ./ -e ssh morein@82.94.91.78:/home/sites/www.more-in.com/site/live/ --exclude-from=rsyncexclusion --stats -h -v # log...)
 
No edit summary
Line 1: Line 1:
<pre>
Migrating from server A -> B
Prepare for the migration:
On A have a virtualhost temp.origdomain.ext
On A have a virtualhost original.origdomain.ext
On B have a virtualhost temp2.tripany.com
On B have a virtualhost original.origdomain.ext
On temp.origdomain.ext add the following to the virtualhost directives:
RewriteEngine On
RewriteRule ^/(.*) http://temp2.tripany.com/$1 [L,R]
And reload the webserver. Then get the domain administrator to change the A record of temp.origdomain.ext to point to server B.
After 2 days, all temp.origdomain.ext should be flowing to temp2.tripany.com. This virtualhost should point to the same DocumentRoot as original.origdomain.ext on server B.
On Server A, add the following to original.origdomain.ext
RewriteEngine On
RewriteRule ^/(.*) http://temp.origdomain.ext/$1 [L,R]
And again reload the webserver. Now all traffic that hasn't got the new A record will be chained to temp2.tripany.com (which shouldn't be much traffic after 2 days) and the rest will go directly to the new machine.
Now all the remaining domain names in temp.origdomain.ext can have their SOA files edited so that they point to server B. Visitors with the old SOA information will be chained through, visitors with the new SOA information will be chained through to temp.origdomain.ext.
</pre>
<pre>
<pre>
# framework rsync
# framework rsync

Revision as of 15:06, 22 April 2009

Migrating from server A -> B 

Prepare for the migration:
On A have a virtualhost temp.origdomain.ext
On A have a virtualhost original.origdomain.ext
On B have a virtualhost temp2.tripany.com
On B have a virtualhost original.origdomain.ext

On temp.origdomain.ext add the following to the virtualhost directives:

RewriteEngine On
RewriteRule ^/(.*) http://temp2.tripany.com/$1 [L,R]

And reload the webserver. Then get the domain administrator to change the A record of temp.origdomain.ext to point to server B.

After 2 days, all temp.origdomain.ext should be flowing to temp2.tripany.com. This virtualhost should point to the same DocumentRoot as original.origdomain.ext on server B.

On Server A, add the following to original.origdomain.ext

RewriteEngine On
RewriteRule ^/(.*) http://temp.origdomain.ext/$1 [L,R]

And again reload the webserver. Now all traffic that hasn't got the new A record will be chained to temp2.tripany.com (which shouldn't be much traffic after 2 days) and the rest will go directly to the new machine.

Now all the remaining domain names in temp.origdomain.ext can have their SOA files edited so that they point to server B. Visitors with the old SOA information will be chained through, visitors with the new SOA information will be chained through to temp.origdomain.ext.
# framework rsync
cd /home/sites/www.more-in.com/live/
rsync -a ./ -e ssh morein@82.94.91.78:/home/sites/www.more-in.com/site/live/ --exclude-from=rsyncexclusion --stats -h -v

# logs
cd /home/sites/www.technicum.nl/logs/

# processed stats
/home/sites/USGP.tripany.com/site/sitestats/www.technicum.nl
/var/log/apache2/awstats/*technicum*

# databases