Migrating a site from another server: Difference between revisions
Jump to navigation
Jump to search
m Red moved page Migrating a site from another Tripany server to Migrating a site from another server without leaving a redirect |
No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 5: | Line 5: | ||
On A have a virtualhost temp.origdomain.ext | On A have a virtualhost temp.origdomain.ext | ||
On A have a virtualhost original.origdomain.ext | On A have a virtualhost original.origdomain.ext | ||
On B have a virtualhost temp2. | On B have a virtualhost temp2.edgarbv.com | ||
On B have a virtualhost original.origdomain.ext | On B have a virtualhost original.origdomain.ext | ||
Line 11: | Line 11: | ||
RewriteEngine On | RewriteEngine On | ||
RewriteRule ^/(.*) http://temp2. | RewriteRule ^/(.*) http://temp2.edgarbv.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. | 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. | After 2 days, all temp.origdomain.ext should be flowing to temp2.edgarbv.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 | On Server A, add the following to original.origdomain.ext | ||
Line 22: | Line 22: | ||
RewriteRule ^/(.*) http://temp.origdomain.ext/$1 [L,R] | 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. | And again reload the webserver. Now all traffic that hasn't got the new A record will be chained to temp2.edgarbv.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. | 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. | ||
Line 29: | Line 29: | ||
<pre> | <pre> | ||
# framework rsync | # framework rsync | ||
cd /home/sites/www. | cd /home/sites/www.somedom.com/live/ | ||
rsync -a ./ -e ssh morein@82.94.91.78:/home/sites/www. | rsync -a ./ -e ssh morein@82.94.91.78:/home/sites/www.somedom.com/site/live/ --exclude-from=rsyncexclusion --stats -h -v | ||
# logs | # logs | ||
cd /home/sites/www. | cd /home/sites/www.somedom.nl/logs/ | ||
# processed stats | # processed stats | ||
/home/sites/ | /home/sites/server.edgarbv.com/site/sitestats/www.somedom.nl | ||
/var/log/apache2/awstats/* | /var/log/apache2/awstats/*somedom* | ||
# databases | # databases | ||
</pre> | </pre> |
Latest revision as of 20:00, 18 January 2017
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.edgarbv.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.edgarbv.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.edgarbv.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.edgarbv.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.somedom.com/live/ rsync -a ./ -e ssh morein@82.94.91.78:/home/sites/www.somedom.com/site/live/ --exclude-from=rsyncexclusion --stats -h -v # logs cd /home/sites/www.somedom.nl/logs/ # processed stats /home/sites/server.edgarbv.com/site/sitestats/www.somedom.nl /var/log/apache2/awstats/*somedom* # databases