#1  
Old 17th August 2010, 17:45
Walker Walker is offline
Junior Member
 
Join Date: Aug 2010
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Moving websites

Currently I'm running a production server with ISPConfig 3.
The OS is Debian-Lenny, and it's configured as described by Falko in 'The perfect server - Debian Lenny'.

Now I want to set up a separate web server (as ISPConfig slave) and move the web sites to that server.
All other services (mail, DNS) will remain on the old server.
Both servers will have their own public IP address.

What is the best way to move the web sites with as least downtime as possible?
Reply With Quote
Sponsored Links
  #2  
Old 18th August 2010, 00:31
Toucan Toucan is offline
Senior Member
 
Join Date: Dec 2009
Posts: 479
Thanks: 78
Thanked 39 Times in 33 Posts
Default

Set the second server up as per the perfect server guide but use the expert option. Use the same root password as the master.

You need to allow the two servers to communicate with each other, although I can't remember which way round. You need to do this in the mysql table.
In phpmyadmin export the root user records and import them to the slave (or maybe the other way around) You need to change the IP addresses to match the other so it can access the tables.


Take a copy of /var/www and subdirectories.

Unfortunately I can't think of an easy way to do the next part...

You'll have to then in the control panel of the master (never the slave) remove the sites and recreate them in the slave.

Then, using your backup copy of /var/www copy it to the slave.

You could use a command like scp to copy the files cross servers.

Remember you'll have to change your DNS records to point to the new server

Feel free to correct me anyone if you feel this method wouldn't work.
Reply With Quote
  #3  
Old 18th August 2010, 01:46
Walker Walker is offline
Junior Member
 
Join Date: Aug 2010
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I don't know if ISPConfig allows to have the same website name on both servers at the same time.

In that case I think the solution below might work:
- A few days before the actual move, I set the TTL of the DNS to something like 120.
- Create the same website on the new server in ISPConfig
- Use NFS to mount /var/www/<website name>/web on the new server to let's say /mnt on the old server
- On the new server: chmod 777 /var/www/<website name>/web
- On the old server as root: cd /var/www/<website name>/web
- tar cvf /mnt/webcopy.tar .
- On the new server: cd /var/www/<website name>
- chmod 710 web
- cd web
- tar xvf webcopy.tar
- change to correct user: find . -user web<old> -print -exec chown web<new> {} \;
- If the website has dynamic content (Joomla, webshop): Set it to 'in service'.
- Export the database(s) on the old server and import on the new one.
- Change the DNS entry to point to the new server.
- Change the TTL of the DNS back to a normal value.
- remove the website on the old server in ISPConfig.

Obviously, above can be done quite fast with a few scripts.

However, if it is not possible to have the same website on both servers at the same time, the above solution won't work.
Removing the sites and then recreating them on the new server leads to too much downtime.
Reply With Quote
  #4  
Old 18th August 2010, 10:44
Toucan Toucan is offline
Senior Member
 
Join Date: Dec 2009
Posts: 479
Thanks: 78
Thanked 39 Times in 33 Posts
Default

Quote:
I don't know if ISPConfig allows to have the same website name on both servers at the same time.
No, ispconfig3 will not allow you to have one website on two servers where one is a slave of the other, unless..... One server is set as a mirror of the other, but then when you stop the mirror function you run into more problems.
Reply With Quote
  #5  
Old 18th August 2010, 11:49
Walker Walker is offline
Junior Member
 
Join Date: Aug 2010
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default

Quote:
Originally Posted by Toucan View Post
No, ispconfig3 will not allow you to have one website on two servers where one is a slave of the other, unless..... One server is set as a mirror of the other, but then when you stop the mirror function you run into more problems.
Is there a way to get around that?
For example, by creating a new website in ISPConfig on the new server with a slightly different name. Then, on the new server in /etc/apache/sites-available I change the vhost file (ServerName and ServerAlias) by hand into the correct website. Now I can copy the files to the new server and point the DNS to it. Afterwards, in ISPConfig, I delete the site on the old server, and rename it to the correct one on the new server. ISPconfig will now 'overwrite' the vhost file, but that's fine because it remains the same website, it just makes it consistent again.

I know it's a bit dirty, but I can't think of a better way to do it.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Moving websites dayjahone General 1 27th June 2008 19:39
Moving websites without downtime (apache2) raypettersen Server Operation 7 21st January 2008 19:00
Moving existing customer databases - rename issue catdude General 2 15th October 2007 23:35
HELP - websites gone in ispconfig itgroup Installation/Configuration 2 8th July 2007 10:23
redirect websites provell General 2 1st December 2006 09:51


All times are GMT +2. The time now is 01:50.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.