Are Partial Migrations from cPanel Possible?

SYSTEM INFORMATION
OS type and version Rocky 8.x
Webmin version Current
Virtualmin version Current

So I have a VPS that we’lll call server1.example.com that has pristine IP addresses, and we want to keep them, for obvious reasons. The hosting company is unable to migrate those IP’s to a dedicated, for whatever their reasons may be. The storage on the VPS is mainly full of mail.

server1.example.com is running cPanel on CentOS 7.9 and needs both an OS upgrade and to be migrated to Virtualmin, which means several hours of downtime assuming everything goes well.

example.com is also the domain of the most-important site on the server, which occupies about 4GB of space and is heavily database-dependent. It also hosts several subdomains and additional domains that have small Web sites, and which send, but do not receive, mail.

As I was sitting in the head this morning it occurred to me that I could avoid some of the downtime by leasing a second, smaller VPS named server1.domain.net (I already own the domain), and moving all things Web to the new VPS, while leaving mail on the existing VPS (but still upgrading the OS, and migrating to Virtualmin on both the new and the old VPS).

In theory, it is possible to exclude mail from a manual cPanel backup using the --skipmail option, but to still make the backup compatible with WHM / cPanel restore using the --userbackup option. That should back up Web site files, databases, etc. while producing a smaller backup file that could be extracted onto a smaller VPS.

Question 1: Would the Virtualmin migration script have any problems using such a backup?

The advantage, of course, would be eliminating Web downtime because the new server could be customized (PHP versions and the like) in advance of the Web sites being migrated over; and tested before flipping the nameserver switches at the registrars.

New nameservers ns1.domain.net and ns2.domain.net would then be created on the new VPS, and server1.domain.com pointed back to the old server. The Web sites would then be migrated, the nameservers updated at the registrars, and mail.eachdomain.tld pointed back to the old server.

Question 2: Will sendmail and PHP mail() on the new server work if mail is pointed at the old server for all except mail.server1.domain.net and mail.domain.net? I can’t think of a reason why it shouldn’t, but maybe someone else has run into problems with this.

Obviously, I also would shorten TTL’s on the old server and create A entries pointing to the new server for Web to eliminate client-side caching issues.

This strategy would also reduce mail downtime because configuring a server for mail only should be quick and easy. The only change I would make from a default Virtualmin install would be to install and configure CSF. There would be no need to diddle with PHP versions and the like.

Now, regarding the old VPS, the plan forming in my head is:

  • Retain its current hostname, server1.domain.com
  • Create regular cPanel backups of all the sites and stash them someplace
  • Install Rocky 8.x and update
  • Install Virtualmin
  • Create placeholder site for hostname
  • Install Roundcube
  • Install CSF
  • Install hacker traps (gotta have some fun)
  • Migrate the cPanel backups back in
  • Delete the contents of /public_html/ for all Virtual servers, just to save space.
  • Request Let’s Encrypt certificates for mail.eachdomain.tld and server1.domain.com only. That should work because ns1.domain.net and ns2.domain.net would already be pointing back to the old server, so it should pass DNS validation.

Question 3: Does this sound sane?

Question 4: When using the cPanel migration tool, is it possible to skip the imports of the Web sites altogether (so only the mail would be migrated)?

Thanks,

Richard

Actually, I might have to install a newer PHP on the old server to run Roundcube. I have to look into that.

But maybe not. I think I can install Roundcube on the new server and it will fetch the mail from the old server as long as the A entries for mail are in place…

Can’t you do a trial run with the cpanel script and see how it goes.

That’s pretty much the plan. I bought a license and spun up a new VPS today and have it all configured save for the hacker traps, which I’ll probably get done tonight. I’ll make a cPanel backup (less mail) of the least-important site on the server and migrate it in as a test.

I really can’t think of any reason why it wouldn’t work as long as DNS points mail to the old server.

Rocky 8.7 / Virtualmin on the new one. I thought about 9, but I’m not an early adopter. I know 8.x has worked flawlessly on the other three, so that’s what I went with.

Richard

I think last time I tried, the only thing that you need is the admin password as it does import it. Thats why I really like about Vutlr, I can create and distroy VPS’ at min cost for this type of testing.

I use Turnkey Internet. There’s a long story behind that, but it begins when my old hosting company had a major meltdown during a Christmas Eve migration. I called Turnkey and a real human answered the phone and got me set up before Santa did his pre-flight.

I’m loyal to companies like that.

Richard

You don’t need to move, vultr is good a test bed. Like when I started with them I deposed $10 (there are no min monthly fees btw) and used that $10 to creating and destroy VPS’s. I was so impressed with it I moved my VPS over to them. BTW destroy a VPS stops all charges and the money stops there until you fire up another VPS.

Thanks. Sounds like a good resource for experimentation, as well as hosting.

I have the hacker traps set up. :grin:

Richard

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.