PDA

View Full Version : Moving websites without downtime (apache2)


raypettersen
13th January 2008, 17:23
Hi

Im in the early process of planning a copy of old websites onto a new server location. Has anyone here done so, without downtime? What would be the best way to accomplish a data transfer, and rerouting web traffic?

Thanks in advance.

falko
14th January 2008, 18:00
Are these static or dynamic web sites? If they are just static HTML files, you can simply copy them over. If they are dynamic and use a MySQL database, you should make sure that the web sites on the old server already use the database on the new server, i.e., both web sites (on the old and the new server) should use the new database to prevent inconsitent data.
You can then change the DNS records, maybe wait 14 days to make sure the DNS changes have fully propagated, and switch off the old server.

raypettersen
14th January 2008, 18:32
Hi, and thankyou for your reply.

These pages are not static, but php webpages that use a single mysql database. I agree on the database move, but the webpages are constantly changing. We host these pages, so im a bit worried that the move will result in some kind of downtime or that a customer changes something on their website, and this change is not copied to the new server.

What would you suggest here? Perhaps a cronjob, with Rsync that copies over differential files if found, and with a newer date?

falko
15th January 2008, 19:30
What would you suggest here? Perhaps a cronjob, with Rsync that copies over differential files if found, and with a newer date?
Yes, something like this: http://www.howtoforge.com/mirroring_with_rsync

raypettersen
16th January 2008, 10:55
Thankyou for your reply falco.

I have one finale question im hoping you could provide an answer to. How do I make apache on the old server, relay a site to the new server adress? I would like apache to redirect our customers one by one to the new server, when we have everything up and running.

This would enable us to do the dns changes without interruption. A friend of mine mentioned something like "mod proxy" (not sure if i remembered it correctly). Is that the way to go?

falko
17th January 2008, 17:08
This would enable us to do the dns changes without interruption. A friend of mine mentioned something like "mod proxy" (not sure if i remembered it correctly). Is that the way to go?
That should work, but I think I'd try smoe mod_rewrite rules instead: http://httpd.apache.org/docs/2.2/misc/rewriteguide.html

raypettersen
21st January 2008, 00:19
These rules are written in .htaccess files?

How would I redirect one website to another server using IP instead of a web adress? Most of the examples use explicite webadress redirects.

falko
21st January 2008, 20:00
These rules are written in .htaccess files?OTE]Yes, or directly in the vhost configuration.

[QUOTE=raypettersen]How would I redirect one website to another server using IP instead of a web adress? Most of the examples use explicite webadress redirects.Replace the hostnames with the IP address. Please note that this only works for IP-based hosting, not name-based hosting.