Doing a server move this weekend. Trying to formulate a gameplan

vbtweb

Member
Jan 10, 2005
23
0
151
I currently have a Cpanel server that I've never seen or physically touched. Not uncommon, but wanted to be clear about that up front. It's been running since 2006 and it's a bit antiquidated.

I've ordered a new server with the same company, with more modern hardware, and increased disk and memory.

They offered to let me pay a one time fee to "leap frog" which I agreed to do. This means basically they will bring up the old server, without bringing down the new one for 72 hours.

During that time I have to migrate everything, and test it. When I believe I am complete, they will THEN move the old IP to the new box.

That being said, I'm betting there are 20 or 30 different ways to do this.

I wanted to share what I thought was the best way, and get some feedback to avoid having a horrible weekend.

The new box will have the OS on it. I'm going to update the os. Then Install Cpanel.

Then ensure Cpanel is updated to my normal build of stable.

I assume I'll have some sort of license problems because of the IP, but I'm guessing it won't prevent me from migrating. If it does, I would request a TEST license from Cpanel for the short duration.

Once new box is up and running cpanel, ---- here is where I'm betting I'm way off. :)

I would log in to all of my accounts cpanel one at a time, run a full backup to their home folder. Then go in and FTP the backup to the new server. Then manually recreate each account in WHM, go in to each one again and restore the full backup.

Harden the new system, then switch it over.

Will this work? Is there a better way?


Also I'm thinking it would be a GREAT time to change to a new hostname. I've been wanting to do that anyways. If I do it, will it cause issues with what I outlined above?


Also do any of you know if Cpanel offers this kind of migration as a service paid or otherwise? I would be VERY happy to let someone better educated in linux and cpanel handle it than me. I did try configserver but they are not doing this sort of work any more. Focusing on hardening and utilities etc.



Thanks alot for any advice/discussion
 

Infopro

Well-Known Member
May 20, 2003
17,075
524
613
Pennsylvania
cPanel Access Level
Root Administrator
Twitter
Personally I would suggest you secure the server first. Configserver can help there and are very reasonable. Assuming your host gives you a basic OS install, I would just go right into installing cPanel and let it do the updates afterward as needed. Your host might even offer a cPanel server, with new IPs might be easier as well. Less rush to limit downtime.

As you say there are many ways to do this move, from WHM you should be able to do a multi account move depending on several factors including how big each account is.

WHM > Transfers section of left menu.

Never heard of the leapfrog deal but most should IMO, give you a week to move to a new rig without cost.

So, you purchased a new cPanel server, setup the new hostname and IPs, secure it properly and update, then move your accounts over, I'd start with one just to make sure things will work as expected, then go back and move more or the rest.

I do know there are a few threads with far greater details you might like to look over around here somewhere as well.

GL!
 

ramprage

Well-Known Member
Jul 21, 2002
651
0
166
Canada
Some things to not forget.

Make sure MySQL versions are the same. If the old server is using version 4 you will need to upgrade it to 5 before migrating the accounts over. Version 4 and 5 data are not compatible.

Recompile PHP/Apache and include all the necessary modules and version details.

Optimize services, configure spam protection and also manage security.

If you're not comfortable with any of these I highly suggest hiring someone to do this for you then you can opt to migrate the accounts yourself or also hire someone for that. Generally moving accounts is the easier part, which you can do through the WHM interface.

Setting up the servers properly involves a lot of shell work, configuration changes, etc.
 

madaboutlinux

Well-Known Member
Jan 24, 2005
1,051
2
168
Earth
I currently have a Cpanel server that I've never seen or physically touched. Not uncommon, but wanted to be clear about that up front. It's been running since 2006 and it's a bit antiquidated.

I've ordered a new server with the same company, with more modern hardware, and increased disk and memory.

They offered to let me pay a one time fee to "leap frog" which I agreed to do. This means basically they will bring up the old server, without bringing down the new one for 72 hours.

During that time I have to migrate everything, and test it. When I believe I am complete, they will THEN move the old IP to the new box.

That being said, I'm betting there are 20 or 30 different ways to do this.

I wanted to share what I thought was the best way, and get some feedback to avoid having a horrible weekend.

The new box will have the OS on it. I'm going to update the os. Then Install Cpanel.

Then ensure Cpanel is updated to my normal build of stable.

I assume I'll have some sort of license problems because of the IP, but I'm guessing it won't prevent me from migrating. If it does, I would request a TEST license from Cpanel for the short duration.

Once new box is up and running cpanel, ---- here is where I'm betting I'm way off. :)
Once cPanel is installed, make sure Apache/PHP/Mysql are on the same version that you have on your old server. Copy the my.cnf and php.ini from the old server to make sure you have the old server settings.

Make some security settings like, installing CSF, mod_security, enable SuPHP etc

I would log in to all of my accounts cpanel one at a time, run a full backup to their home folder. Then go in and FTP the backup to the new server. Then manually recreate each account in WHM, go in to each one again and restore the full backup.
Rather than logging to cPanel of each account and performing a backup, it's better to do that from shell using a script. Use the following script to perform the bulk backup and copy the cpmove-user.tar.gz files over to the new server.

for i in `cat /etc/trueuserdomains | awk '{print $2}'`
do
/scripts/pkgacct $i;
scp /home/cpmove-$i.tar.gz root@newserverip:/home/
done;



This will create a backup of each account and will transfer it on the new server. To make the scp command work without a password, you will have to generate a SSH key on the old server and put it on the new one.

Once the backups are copied over, login to your new server and execute the following:

for i in 'ls -la /home/ | grep cpmove | awk '{print $9}' | cut -d- -f2 | cut -d. -f1'
do
/scripts/restorepkg $i;
done;


That's it.

Harden the new system, then switch it over.

Will this work? Is there a better way?
Hardening is done in first step and the migration in the second step.


Also I'm thinking it would be a GREAT time to change to a new hostname. I've been wanting to do that anyways. If I do it, will it cause issues with what I outlined above?
Yes, you can change the hostname once everything is migrated. Changing of hostname won't cause any migration issues. It has nothing to do with it.


Also do any of you know if Cpanel offers this kind of migration as a service paid or otherwise? I would be VERY happy to let someone better educated in linux and cpanel handle it than me. I did try configserver but they are not doing this sort of work any more. Focusing on hardening and utilities etc.



Thanks alot for any advice/discussion
Well, if you are not sure how this migration works OR what is the proper way, have someone do it for you.
 

Silver_2000

Well-Known Member
Mar 31, 2002
337
1
318
Ive migrated from server to server a couple times over the years

like others have said get the server up and running and hardened first - do what you can to match versions between servers

Then look at the accounts that have a ton of data ( more than a couple gb )
Those wont move well with the Cpanel acct move in WHM
"Copy multiple accounts/packages from another server"

I have used it a number of times - The biggest hint I would offer is to if possible move large data chunks using Rsync - in my case I worked with the account owners to close photo galleries to uploads for a day or 2 - then righht before the server move move the large GB folders OUTSIDE the account folders and then use the tool above - that tool moves everything - email - ftp - dns everything - then move the big chunks of data using rsync - check folder permissions/owners of rsynced files and begin to change DNS to start using new server

Since both servers are on the same network see if you can use internal IP for faster transfer - also see if you can keep the servers up side by side for more than 72 hours - you can change DNS then forward the DNS on the old server to point to the new - to try to reduce DNS issues.

Finally I typically asked the host to move the drive from the old server to the new box so that in case I missed anything I can get it from the mounted old disk

Good luck
 
Last edited:

madaboutlinux

Well-Known Member
Jan 24, 2005
1,051
2
168
Earth
Yes, incase of a large account say in GDs, WHM transfer option is not a good option. In that case, just

1. rename the home directory of the account i.e. /home/username to /home/username_bak
2. create a empty home directory /home/username
3. transfer the account using WHM option OR manually by using the pkgacct script.
4. delete the temporary directory /home/username
5. rename the original directory back to /home/username
6. then use the rsync command to transfer /home/username to the new server.

This will make sure the account is created properly on the new server with all it's settings and the large home directory of the account is migrated properly as well.
 

vbtweb

Member
Jan 10, 2005
23
0
151
Thank you so much for all of your advice. I'm almost completey finished without a single issue so far, and I owe that to reading your replies.

I did try to hire Configserver to do the whole job, but they were not interested, wouldn't even talk price :) I'm glad to see them doing so well that they can turn down work. He defiently deserves it.

So here is the process I used.

New server came up with simple OS Install.

I ssh'd into it.

I pulled up Cpanel documentation, and followed the command line intructions for installation. Once it began, it took several hours.

When complete, I couldn't log into cpanel/whm/ do anything. I was worried I did something wrong. As it turns out, http is not enabled after you install cpanel. I did some googling and found a way to get that straight.

When I went to cpanel IP:port for the first time, I went through the new setup wizard. I answered all of that and was up. Here is where I noticed WHM looked a little bit different.

When I following the CPanel docs it had me get and install CURRENT, and I only use STABLE. So you know what that means. Someone needed to change. So I went to the old server, and changed it to Current and updated.

Then once done, I went into easy apache on both servers side by side, used the exhaustive option build list and made sure everything on the new server was the same as the old, and let it build.

Then I installed CSF, and Explorer.

I tried to set up a new drive, and was really dispointed that cpanel wouldn't allow me to partition the drive. I had an extra 160 gig drive, I wanted to partition 80 to /backup and 80 to /internaluse

It wouldn't allow any partition options. I googled for a bit on fdisk and partedd and such, but decided I didn't want to try to manually do it.

So in the end I let cpanel make 1 partition out of it, and just mounted it /internal and made a sub folder of /internal/backup and pointed backups to it.

Then I did the whm --> transfer and gave it the ip / root of the old server, and the user name to transfer. It did it. It looked right. I tested it http://ip/~username/ and it was working as it should. I specifically picked an account the was using sql database integration, zlib compression, etc.
Success. So then I got brave --- I did it again but picked mulitple accounts, and it went and fetched a list of users. I check the ones I wanted to move, and sent it moving. It worked for a long long time. At times I would think it was stuck and then it would move again, especially the accounts that had many gigs of data. However in a resonable time, it was done. I checked every single account and it was perfect. So lucky :)

So I created new packages, and modfied multiple accounts to move them into the correct ones. (I had read this is better than trying to import from old server)

And I ordered CFS services. As great as they are, I've learned lately that things have changed in the last 3 or 4 years over there, and it might take some time before ... . . well . anyways, this won't happen quickly, especially with our timezone differences, and the Stone Gatekeeper.

That was Day 1



Day 2, moved domains that used NS resolution to the new NS's.
Moved domains that we internally manage DNS to the new IP.

All took, all work, all propagated. Success.

Day 3, still waiting on Config Server. I'm hoping it can get done today. Tomorrow the "leap frog" server service expires and I lose the old server.



(Hijacking my own thread here)


And as someone stated earlier, I shouldn't be charged for that, I completely agree. I have a really really really weird host.



They are about the best priced period. I mean just way under their competition.

They are owned by a Tier 1 datacenter so their bandwidth is incompariable.

So whats the catch? They are insane. No people skills, and will tax you like the irs combined and hit you with fees like the banks.


I pay them for 1 year like 5 years ago, for the server plus cpanel license.

I was new to cpanel and having some issues. I sent them a support ticket, they responded that it would be 100$ (or something like that) per incident.

I asked them why it cost money, I just bought it yesterday, can't they help me get started? The responded -- get this

It would be 100$ per incident -- and because I've sent in two tickets in one month, they were going to charge me 25$ fee for excessive use!

So I called them, (so not to rack up more charges) and they told me the phone isn't for support, to use the ticket system. Then hung up on me.

So I wait a month and send a reply that its not fair about the 25$, and that I will pay them 100$ for the incident I asked about etc.

They responded that it was fair, and I had to live with it, and then they reloaded my server for 100$ ( I had rootkits already) I was even worse of a o O then.

Thats when I found Chirpy. He picked the OS, set it up, and locked it down for me. Never had those problems again. I did however, have some cpanel issues from time to time, and I couldn't get support from my host who to be honest, had less idea of how cpanel worked then I did, and still wanted insane money to try to help me. So when time came to renew I started doing some math.

I could save over 100$ a year, if I dropped Cpanel from my host, and bought the license myself directly from Cpanel. Which comes with what?

Support. I've used it maybe once, but I didn't pay 100$ for it.

So yeah when I wanted an upgrade it was 75$ to use both servers for 72 hours only. I asked if I could keep the temp IP assigned to the new server, so I wouldn't have to go make alot of changes when I change it later. They said sure, for 30$. I got a good laugh.

I complain about them, but it would be difficult to ever get me away from them. Server doesn't go down, bandwidth never sucks, and if you keep your mouth shut and don't bother them, prices are amazing.

Of course if they ever see this rant, I'll probably be in the poor house. :)
 

Silver_2000

Well-Known Member
Mar 31, 2002
337
1
318
not sure how much you pay per month for your server but based on your description of how cheap the host is it cant be much - why wouldnt you just pay for both servers for a month ?
That gives you time to better plan and prepare ... Gives chirpy time to get to your server.

Since you arent getting any support to speak from from your host I would buy cpanel direct as well.

One thing that would concern me about a host like yours is the likely hood that they will be around long term - crappy customer service driven by low prices combined with nickel dimeing customers - doesnt bode well for long term ...
 

vbtweb

Member
Jan 10, 2005
23
0
151
Your right. I've wondered why I didn't do that as well. The 75$ fee cost more than 1 month of service. However I leave well enough alone, because it doesn't pay to rock the boat with these guys. Sounds horrible I know. They are owned by a parent company who seems to be strong. And they do a good enough job that I don't really need to talk to them at all except to pay a yearly invoice. So the weirdness that they are becomes lost on me until I have to deal with them again. I think they charge less because you do not get any customer service. So basically I put up with that, because I'm not paying for it.
 

Infopro

Well-Known Member
May 20, 2003
17,075
524
613
Pennsylvania
cPanel Access Level
Root Administrator
Twitter
...As great as they are, I've learned lately that things have changed in the last 3 or 4 years over there, and it might take some time before...
I'm not sure why you'd be bashing chirpy, but I disagree with you. In fact I've just brought a new server online myself, hired him and was pleased as always with his work.

If you're unhappy with your host you might look into a new one. There are many to choose from.

GL with the new server.
 

vbtweb

Member
Jan 10, 2005
23
0
151
Holy smokes. I'm not bashing him. I didn't mean that at all. His work, skill and ethics, are completely incontrovertible. I guess all I was trying to say is that I've had slower turnarounds then I had in the past. Could be completely coincendental. I wouldn't put a whm/l server live without him, and I'm sincerely sorry if I sounded like I was bashing him or demeaning him or his service in anyway.