PDA

View Full Version : Moving to a New Server



vangogh
10-09-2015, 06:43 PM
Hey All,

Thought I'd let everyone know, I'm having the site moved to a new server. I think it's going to start sometime tonight (10/9/2105), though it may be tomorrow.

You shouldn't notice anything while things are being moved, however when I change name servers there will be a time where some people see the site on the current server and some see it on the new one. I'm mentioning this because it's possible if you post something over the weekend you might end up on the current server even though the site is on the new server, in which case it may not be there in a day or two when all the changes have gone through.

Just wanted to let you know in case you post something over the weekend and don't see it on Monday. It's possible it ended up on the wrong server.

I apologize in advance if something you write seems to disappear. If that happens let me know. Odds are I'll be able to access things and add them after everything is moved.

vangogh
10-10-2015, 11:20 AM
Still waiting on the server move. I'll update this thread again when I know more.

vangogh
10-11-2015, 11:21 AM
Still waiting. I received an email suggesting the move would go through yesterday and nothing happened and I haven't heard since. Perhaps today. I'll keep everyone updated as I know more.

Owen
11-01-2015, 01:32 AM
Who did you move to?

vangogh
11-02-2015, 12:55 PM
I haven't finished moving yet. The company that will be hosting the forum is Webair. They moved the site and I tested it, but because the forum is updated all the time with new content, I need to move a bunch of tables in the database again. I want to do that over a weekend so there's as little disruption as possible, but I haven't been able to the last few weekends. I'm hoping this weekend I'll have the time.

Brian Altenhofel
11-02-2015, 02:47 PM
Will they not let you set up the database as a replication slave? Or put the two databases across hosts in master-master replication? That's how I usually do zero downtime migrations.

vangogh
11-02-2015, 05:14 PM
It's possible, but all that went over my head. I was originally going to do everything myself, but I gave them a call and asked them to move everything. Unfortunately they did the work on a Wednesday and by the time I knew everything had moved, I was going to have to move whatever had updated.

I'm mostly concerned for when he DNS propagates. Depending on where you get your internet you might be on either the new or old site for a day or two. That's why I figured it would be best to finish up over the weekend. My plan is to spend Friday afternoon updating the tables that have changed on the new database and then flip the nameserver switch Friday night. It's usually quiet enough over the weekend that not too much should change while the DNS changes take effect. Then I'll go in to the old database after the weekend and update what might be different between the two servers.

What's the easiest way to update the tables? I'm sure this isn't the most efficient way, but I was planning on exporting the tables from the old server and then deleting the same table on the new server and importing. The problem with that approach is there are 65 or so tables that I know have updated and by the time I complete the process I'm sure some of them will have changed again. I'm thinking if I started late enough on Friday, there won't be too many changes made after I get started.

Freelancier
11-02-2015, 05:53 PM
Have whoever is managing your DNS to reduce the TTL time to an hour.

MyITGuy
11-02-2015, 06:20 PM
What's the easiest way to update the tables? I'm sure this isn't the most efficient way, but I was planning on exporting the tables from the old server and then deleting the same table on the new server and importing. The problem with that approach is there are 65 or so tables that I know have updated and by the time I complete the process I'm sure some of them will have changed again. I'm thinking if I started late enough on Friday, there won't be too many changes made after I get started.

If you can't do replication then I would suggest the following:
1 - Drop the TTL (Time to Live) values down to 1 hour asap.
2 - When its time to perform the migration - put the board in maintenance mode.
3 - Export the database on your old host using your favorite tool (Assuming phpMyAdmin?)
4 - Import the database on your new host using your favorite tool (Again, phpMyAdmin?). I can test, but you may need to drop/delete the database first from your new host.
5 - Login to the new host (Either via Domain if it replicated, via IP if you have access, or via editing host file as a last resort) and remove the board from maintenance mode.

During the migration the old host will be in maintenance mode to prevent any new posts (If you can put a message to redirect them to the IP that would be great) that you have to worry about replicating later. We will understand! :)

vangogh
11-03-2015, 04:55 PM
Thanks. Oddly enough my hosting company called this morning asking if I'd tested the site on the new server so they could update the database. I hadn't realized they were going to do that work too. I set things up for Friday evening and as soon as everything has been updated, I'll do a quick test and then change the name servers.

I thought about putting the site on the current, soon to be old server, in maintenance mode, but I didn't want to shut things down for a couple of days. It's hard to know when all the DNS cache around the web has been changed. I suppose people would only see the maintenance message if they're looking at the old site so maybe that's what I'll end up doing.

I was thinking we don't have a lot of activity between Friday night and Sunday night and I could leave both sites up and move anything new early next week. I don't expect there will be a lot of activity over the weekend. If I do that I'll leave a message somewhere to let people know what's going on so if they don't see their post a day or two after making it, they'll know why and that it'll show up in another day or two.

Guess I'll think about it the next couple of days and decide what to do. Setting the site on the old server to maintenance mode is the easiest thing for me, but I didn't want someone to visit hoping to ask a question and not be able to.

Thanks again for the advice.

MyITGuy
11-03-2015, 10:41 PM
I thought about putting the site on the current, soon to be old server, in maintenance mode, but I didn't want to shut things down for a couple of days. It's hard to know when all the DNS cache around the web has been changed. I suppose people would only see the maintenance message if they're looking at the old site so maybe that's what I'll end up doing.
If you drop the TTL value down (qhich looks like you did as I see it set to 300), the cached queries will be reduced quite significantly and everyone should be hitting the new server within the hour, unless the user intentionally overrides the TTL values by maintaining their own DNS/Cache server.

In the event it helps, two quick tools to use to check propagation are:
http://viewdns.info/propagation/?domain=small-business-forum.net
https://cachecheck.opendns.com/ (Check and Refresh)

Brian Altenhofel
11-04-2015, 09:46 AM
For what it's worth, I've had success with dropping TTL as low as 60 seconds. There are a few ISPs that won't honor it, but they almost always fallback to 1 hour.

If your new host is handling data migration, no reason not to let them. The (oversimplified) steps I usually take for a migration are:

1. Lower DNS TTL
2. Setup database at new host as a replication slave to the old host.
3. Wait to schedule switchover until database at new host is within a few seconds of slave lag to old host.
4. Promote slave at new host to master and switch master at old host to slave (in case there needs to be a rollback to the old host).
5. Configure app at old host to point to database at new host.
6. Switch DNS.

Usually 95% of traffic is switched over within 2xTTL, and most of the rest is switched within an hour. Typically I'll keep the old host online for 48 hours just to be sure and then drop it. There are some ISPs and services (particularly search engine bots) that do permanently cache a DNS entry until that IP quits responding to that domain name (which can be a big issue if switching from a really cheap shared host whose servers use a default vhost entry).

vangogh
11-06-2015, 07:46 PM
Thanks for the help guys. Everything has been moved and I put the forum on the old server into maintenance mode. If you're seeing this, you're on the new server.

billbenson
11-10-2015, 06:57 PM
Man, took a while to propagate. But I'm on the new server now.

vangogh
11-10-2015, 07:52 PM
Wow. It shouldn't have taken that long. I changed nameservers on Friday evening. For me things propagated sometime Saturday evening, but I noticed some people already had access later Friday night and more by Saturday morning. By Sunday evening all the propagation should have been finished. I wonder if your ISP or your computer hangs on to DNS cache longer than it should.

billbenson
11-10-2015, 07:58 PM
For me godddy propitiates within minutes. I tried it late Monday and nothing. Just triied it a few hours ago and it's on the new serer???????

vangogh
11-11-2015, 11:19 AM
GoDaddy wouldn't have anything to do with this. It's not about the server itself or the registrar. 30 seconds after I changed nameservers, who-is records were showing the change. The reason it can take so long to see the changes is because ISPs cache DNS information to generally help speed up connection times. Some ISPs take longer to replace their cache of the DNS records and until they do they keep pointing to the old server.

When you were able to see the new site depends on when your ISP updates its DNS records.

I changes my hosts file on an older computer so that computer would always see the site on the new server, even before I made the nameserver changes. The new server started getting traffic within a few hours. My ISP updated some time on Saturday, though plenty of people were already here by then.

I'm not sure why it took so long for you to see the changes though. Within 48 hours every ISP should have flushed their DNS cache and been using the new information, but for some reason it was another day or so on your end. No matter. It's working now.

billbenson
11-11-2015, 01:39 PM
Whenever I've changed nameservers its pretty much immediate. I understand how the ISP's update as described above. Just weird how long it took this time.