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
andserver1.domain.com
only. That should work becausens1.domain.net
andns2.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