Web Hosting Talk







View Full Version : Ok I'm moving from a shared to a dedicated tonight and want to minimize downtime.


thomor25
10-13-2004, 06:33 PM
I'm moving a forum from a shared server to a dedicated tonight and want to be as little downtime as possible. How can this be done? I'm gonna go do a search now to read up but are there any reccomendations by anyone? I will be changing ips, name servers, and moving over files and a large database to the tune of 1.6gb

sightz
10-13-2004, 06:39 PM
Tonight?!?

If you had asked a week or so ago people would have told you to reduce the "time to live" and "refresh" on your dns record so the changes would go thru quickly.

thomor25
10-13-2004, 06:42 PM
Yeah, the server should be or is done being built now and the move should be tonight.

BeasTboyz
10-13-2004, 06:44 PM
To get around what sightz is saying, after the move you could change the default page to a new html file in which you explain what you did and how to flush their dns (start > run ipconfig /flushdns) and clear their cache. You should still change your TTL though so that new visitors will only cache dns for a very short period. (I'd set it to 15 minutes (900) or less).

If you gave us a little more information about what OS and control panel you're moving from and what control panel and OS you are moving to, that would help us know where to get started helping you.

thomor25
10-13-2004, 06:48 PM
from a shared account on a
dual xeon
2gb ram
redhat ent
cpanel


to a dedicated
dual xeon
2gb ram
redhat ent
cpanel

BeasTboyz
10-13-2004, 06:48 PM
Originally posted by thomor25
Yeah, the server should be or is done being built now and the move should be tonight.

Well, unless you're having someone completely secure it for you and set everything up, I would HIGHLY recommend you go through it yourself and set everything up.

I would then perform a test move on a site or two to make sure the databases import fine and everything. There may be problems importing databases (like error 2006), where you need to adjust small things like max_allowed_packet. Maybe you forgot to enable exif support in php and your photo album changes a bit.

I know you're in a rush to get over to the more stable faster new server, but I would at LEAST give it a few days.

I'm only moving a few things and I'm on day 6 of moving my site and a friend's to a new server. We're changing from linux to windows, so the change is pretty drastic. This isn't the first move I've done though, and even moving from a cpanel rh9 to cpanel rh9 server takes a fair amount of preparation.

sightz
10-13-2004, 06:48 PM
Originally posted by thomor25
Yeah, the server should be or is done being built now and the move should be tonight.

May I suggest a week or two to test, configure, and secure the new server?

Just because a box is online doesn't mean it is ready for prime time.

thomor25
10-13-2004, 07:00 PM
its 100% managed its at www.liquidweb.com

BeasTboyz
10-13-2004, 07:01 PM
OK a few more questions, so its easier to answer.

Does your shared account have WHM (like a reseller account?)

How many different databases?
How many different sites?

When does your current hosting plan expire?

thomor25
10-13-2004, 07:03 PM
Originally posted by BeasTboyz
OK a few more questions, so its easier to answer.

Does your shared account have WHM (like a reseller account?)

How many different databases?
How many different sites?

When does your current hosting plan expire?


The site is being moved to a new server, its just one site www.phpbbforfree.com
I have root access and whm
only 1 database

BeasTboyz
10-13-2004, 07:29 PM
OK


On the new server I would set up your DNS zone for phpbbforfree.com.

At the same time I would set up DNS servers on the new server so that when you change your DNS at the registrar and it propagates, it will be a seemless transition. I would set this to happen in a couple days. That way you can just go to the registrar and change the DNS info whenever you want.

I would move ALL static pages and files to the new server via ftp.

Now, so long as the server is set up and mysql, php, etc work, I would stop services on your current account so that the databases won't be changed during the backup and moving process.

I would then backup the database using:

mysql --opt -udatabaseusername -p databasename > /home/user/databasebackup.sql

This will prompt you for the database password and will backup to the location/filename listed after the >

If you haven't created the username and pass for the mysql account on the new server you can do this by typing: mysql -uroot -p GRANT ALL PRIVILEGES ON databasenamehere.* TO databaseusername@localhost IDENTIFIED BY 'passyouwanthere'

Have your new server grab this file and then restore the database using:

mysql -udatabaseusername -p databasename < /home/user/databasebackup.sql.


Now, on your shared account I would change the domain phpbbforfree.com to point to your new IP address. The moment you do this, so long as the domain is set up on the new server, new requests from someone that doesn't have your domain and IP cached will be directed to the new server.

Now on your shared hosting account, change the default page to index.html and create an index.html explaining to users how to flush their DNS and clear their cache so that they will be using the new server. Also tell them that if they don't do this, it won't take effect for around 24 hours. I'm not sure, but a reboot may work?

This way they aren't using the real site on the old server thinking everything is going along fine, only to change to the new server on their next visit and see missing posts and what not.

Anyhow, I'm watching everybody loves raymond as I'm typing this and I'm laughing my *** off. So hopefully I didn't forget to many things.

If you need help with this, IM BeasTbyz.

Matt

I forgot to mention that whm has an account transfer function, but I wouldn't rely on that for such a large site/database. My way listed above might be a bit slower, but it will be a perfect move.

Alternatively you could use the site backup function in cpanel on the shared account and then transfer that backup to the new server and restore the account through ssh. I can't remember the command to do this, but you could find it quickly searching at http://forums.cpanel.net

BeasTboyz
10-13-2004, 07:33 PM
Also, right now I would change your refresh time and time to live (TTL) in whm on your domain name.

These will look like:

900 ; refresh period
86400) ; minimum TTL period

This way the changes will take effect sooner for those who visit the site and cache the DNS between now and the move.

Matt

thomor25
10-13-2004, 07:44 PM
done the refresh but the ttl was 86400 already

thomor25
10-13-2004, 07:53 PM
Oh I forgot to say i really appreciate your help

BeasTboyz
10-13-2004, 08:30 PM
oops, I'm sorry I didn't specify a time to set for those values. Set them both to 900. And the help is no problem. Be sure to let us know how it goes.

thomor25
10-13-2004, 08:32 PM
set what to 900?

thomor25
10-13-2004, 08:34 PM
refresh is 900
retry is 7200
expire is 3600000
and minimum ttl is 86400

and then under that is a while bunch of ttl's that are 14400

BeasTboyz
10-13-2004, 08:42 PM
set any TTL to 900

BeasTboyz
10-15-2004, 12:23 AM
Care to update us on this and let us know how it went?

thomor25
10-15-2004, 12:24 AM
Hasn't happened yet, server would have been ready but cpanel is having problems with one of their lisc servers or something.


Also someone sent this to me in a pm, is this possible?

I changed the TTL on the DNS A records to 0 and waited for the cached values to expire (that took a while as we needed to change nameservers at the same time). The day before I made a complete copy of the databases and files while the site was live. On the night of the switch, we turned off the board, copied all of the recently changed files over to the new server, (much quicker than copying the whole thing) flipped the switch on the DNS records, and that was it. If anyone had a cached DNS entry they would just see the old site, but statistics from the old host showed that this didn't happen to too many people.

It was seamless and the users of the site never felt a hiccup.

BeasTboyz
10-15-2004, 02:38 PM
Yeah, completely possible, but if you don't do a fresh backup of the database the second after you shut off the boards on the first server, move that database to the new server and restore it, then you're going to have missing posts. Especially if you back it up the night before, all posts made between the backup and move will be gone. It is also possible to set TTL to 0, nothing wrong with that, people will just be querying the DNS server every time they access the site.

I'm guessing he doesn't run a bulletin board, because BBs are constantly changing and a backup the night before wouldn't be sufficient for a mid-day move if you didn't want to lose posts.

Other than that, he's essentially saying he did what i said to do.