cPanel Migration

10 posts / 0 new
Last post
#1 Tue, 12/01/2009 - 21:36
rrhode

cPanel Migration

Hi there,

I am in need of some of your guys beautiful, wonderful, amazing super help =)

I have a Virtualmin GPL server (hopefully they will get the unlimited Pro version some day soon) and I am trying to migrate from a crappy cPanel server. Crappy because it keeps losing connection through FTP.

The thing is unreliable and does not seem to have the ability to connect through SFTP, SCP or SSH. However it does have FTP but it doesn't seem to remain connected reliably. This is part of the problem. The connection just times out randomly.

The other part is that cPanel does not have a backup module in it and I can't create cPanel backups to import into Virtualmin. I notice that it has the ability to connect through FTP to retrieve the backup file, however I have no backup file. All I have is ftp into the root of the server.

The server has probably about 200 domains on it or something like that, tons of email accounts, its huge. I don't want to download it all to my local computer and then upload it to the new server because it would be way too big and take way too long. So how can I do what I am trying to do with this connection that times out?

Is it even possible to import cPanel from a non backup file or am I looking at a huge long process here?

Any suggestions or recommendations at all are welcome =)

Thanks for reading!

Ryan

Tue, 12/01/2009 - 22:48
andreychek

Hey Ryan,

Well, unfortunately, my recommendation is going to be to somehow get the backup files onto the Virtualmin box before you get started.

While it may take awhile, it shouldn't require you to babysit it... just download it, go to the local theme park and hit up some roller coasters or something... or perhaps catch up on your Christmas shopping!

A few notes though --

  • You definitely need the cPanel backup files in order to import your domains into Virtualmin. Unless that feature was somehow disabled, there should be a means to generate backup files for your domains. I mean, not being able to backup your domains is a big deal :-) You may be able to ask your provider about it, or perhaps even cPanel's support.

  • I don't recommend performing import with Virtualmin using an unreliable connection, it'll just make your life more difficult :-) So you may want to copy those backup files over manually (once you figure out how to create them), somehow or another. I don't have any great suggestions on how to do that -- other than you could keep reconnecting and finishing the FTP transfer.

  • You can probably do the transfer in one step. Don't download it all to your desktop, and then back up to the other server, that'll just make all this take longer than it needs to... log into the Virtualmin server using SSH, then use a command line FTP program to log into your other server via FTP in order to download the backups.

I hope that helps!

-Eric

Thu, 12/03/2009 - 11:21
rrhode

Hi Eric,

Thanks! That does help =)

Well, unfortunately, my recommendation is going to be to somehow get the backup files onto the Virtualmin box before you get started.

So I did some searching and I was able to find a document on the hosts site saying they disabled the backups for resource reasons. And then I tried to post a ticket to their support area but got a blank page. I told the client to contact them and enable the backup button.

While it may take awhile, it shouldn't require you to babysit it... just download it, go to the local theme park and hit up some roller coasters or something... or perhaps catch up on your Christmas shopping!

That would be really fun, but I live out in the boonies in a tiny little town in central Ontario, Canada. No theme parks here, no malls, not a whole lot but a bunch of rednecks. We can't really stand it here anymore so we are about to hit the road.

Thank you so much for taking the time to post in such detail! I will be sure to follow them as soon as I can make the backup file =)

Ryan

P.S. For some strange reason nothing comes up when I click the Preview button below. I know it has worked in the past. I thought maybe it was because I was trying to use bbcode to quote you but I tried with just the word test and it still doesn't show anything. So hopefully the quotes work and maybe I broke your Preview button.

P.P.S Quotes didnt work lol

Wed, 12/02/2009 - 06:40
andreychek

P.P.S Quotes didnt work lol

Yeah, it's "cite" rather than "quote" :-)

Thu, 12/03/2009 - 01:36
rrhode

Ok so I have managed to get the cPanel backup file (54 gigs) over to the new server. However it times out when analyzing the file. The first step after clicking the Migrate Now button.

This machine seems to be a beast with Intel(R) Xeon(R) CPU E5540 @ 2.53GHz , 16 cores and 16 gigs of RAM and two RAID1 750GB SCSI Seagate drives. So if it can't do it then what can?

I am guessing I have to tweak a file somewhere to allow for a longer timeout period but I have no idea where this might be at. Any hints? =)

Thu, 12/03/2009 - 04:23
rrhode

Hold the phone... I think I figured it out by using the command line. Man you guys are ridiculously awesome.

In a terminal just type:

virtualmin migrate-domain --source filename --type cpanel --user cpaneluser --pass cpanelpass

More info here:

http://www.virtualmin.com/documentation/developer/cli/migrate_domain

On mine it said .. validation failed : A password must be supplied for cPanel migrations until I added in the --user and --pass parameters.

Thu, 12/03/2009 - 03:19
rrhode

FYI, I also had a session timeout issue with the terminal disconnecting with Putty so to fix that I went into the settings for the session in Putty and to Connection and changed the Seconds between keepalives to 120.

Thu, 12/03/2009 - 08:04
andreychek

Cool, so it sounds like things are working out okay for you then? Your import went smoothly once you got around the timeout issues and set the passwords?

-Eric

Thu, 12/03/2009 - 12:09
rrhode

Hi again,

OK, it seems to me like it worked pretty well using the command line to do it. Then I realized that it still had all the servers in as what it refers to as subdomains which I guess is technically the way it had it in cPanel since it has a WHM panel above that. However I don't want every site to be running as the same user like it had before and have switched it to use fastcgi. I want to convert them to be parent level servers so they can each run separate since it is supposed to be more secure like that.

Also when migrating the cpanel backup file in it did not copy the /etc/skel files in which contain the fcgi-bin/php5.fcgi and php/php.ini files. It has the ${HOME} variable replacement in the php.ini file. It is probably good that it doesn't copy these files since they could be anything and overwrite the site files, but in this case those files are necessary for the operation of Apache. I have 511 virtual servers on here it says, I don't want to have to do them all by hand if I can help it. Is there some way to do this automatically like some sort of repair utility somewhere I don't know about or something? Do I have to figure out how to write a script to do it?

To make matters worse, it seems I have to convert the subdomain to a sub-server and then to a parent server. And even worse in the final process while converting to a top level parent server it gives an error saying it cannot move the files. It is trying to move a domain alias which was listed under the subdomain and that is what it seems to be failing on. I could probably just manually mv the folder and chown it to the new user but is this a bug?

I have this in the webmin logs:

[03/Dec/2009:07:06:23 -0500] Reloading configuration
find: /home/****/domains: No such file or directory
chown: missing operand after '943:503'
Try 'chown --help' for more information.
chown: cannot access '/home/****/domains/****.com/homes': No such file or directory

Is there some simple way to automate this for this many servers?

Thu, 12/03/2009 - 08:35
andreychek

I want to convert them to be parent level servers so they can each run separate since it is supposed to be more secure like that.

Yeah, it all comes down to exactly how secure you want/need it. Sure, each and every domain/sub-domain running as a separate user with suexec would be more secure -- but if those are all managed by the same person, who has to log out and back in as another user to do maintenance, it's a bit of a headache. So you just have to decide what tradeoffs you want to make :-)

Is there some way to do this automatically like some sort of repair utility somewhere I don't know about or something? Do I have to figure out how to write a script to do it?

I suspect that for a migration, that it's not pulling the files from /etc/skel. Those are typically for newly created accounts, I suspect it assumes that for migrations, that you already have all the files you need.

I suspect you'll need to figure that one out with a script :-)

It is trying to move a domain alias which was listed under the subdomain and that is what it seems to be failing on. I could probably just manually mv the folder and chown it to the new user but is this a bug?

Yeah, that sounds like it may be a bug. You can submit a bug report using the Support link above, and Jamie will work with you to figure that out.

Is there some simple way to automate this for this many servers?

Well, if it is possible, it'd be because the ability to move a domain to a top-level server existing in the command line tools. I don't see that feature ATM, but you might want to double-check.

If not, you could always sneak a feature request in along with your bug report ;-)

-Eric

Topic locked