I am struggling to move a existing VPS to a new server.
Old: Ubuntu Server 20.04 Webmin: 2.105 Virtualmin: 7.8.2
New: Ubuntu Server 24.04 Webmin: 2.111 Virtualmin: 7.10.0
The VPS is hosting multiple websites with most hosting mail plus a few domains only hosting mail.
First I setup a virtual domain with a spare domain name I own, set the DNS records. This works fine I can access the associated website as well as :10000 for the virtualmin control panel.
Next:
I have created backups, transferred one simpler setup (only website no email) over to the new VPS restored the .tar file and switched the DNS records over to the new IP. The website works fine.
To test the email I created a new user for and used Thunderbird to connect to the server. Now for the strange part:
During the account creation process Thunderbird probes the mailserver for details and the server responds with the as mail server name?!
So I went and clicked to use LetsEncrypt SSL certificate for for Webmin, Webmin (global), Usermin, Usermin (global), Dovecot, Dovecot (global), Postfix, Postfix (global), but Thunderbird stills gets as the name for the mailserver.
I need to be able to have the system to respond with a domain name I can set (incl its certificate) so my clients don’t have to change their mail settings once I switch to the new VPS.
The versions differ because I had not done any updates on the old VPS for a while now … Yes I know … but I am always very cautions with any updates I do on a live server.
To answer the first question: Yes the intention is to use backup/restore to move the domains over (followed by a live syncing of IMAP of course).
What I don’t understand is why Thunderbird picked up the restored (second) domain name as the mailserver name? I will go and restore a second domain and see if this changes again.
Id be more worried about moving from different version of Virtualmin then updates.
Updates are very well tested before they released.
Not sure why Thunderbird would do that, did you use HOST on your PC to change to the new server or is it via DNS?
I don’t understand what you mean with ‘use HOST’? All Domains I host have DNS records including a MX record pointing to mail. which then (via *.) itself points to the IP address.
I too have no clue as to why Thunderbird would do this - hence my question?
Do you think ? have a DNS issue (pretty sure the records are fine as they had been working all those years)
Would you recommend to upgrade Webmin/Virtualmin on the old VPS before doing a backup/restore cycle?
HOST file lets you test the new location without changing the DNS (and dns do take time to update)
Thunderbird will follow the HOST file settings, you may need to add the mail setting to the host, like mail.domain.com, whatever you use in Thunderbird.
Sorry my bad. Yes I know about the /etc/hosts file and no none of the domain names in question is in there.
The DNS records for both domains in question have 2 A records ( A ipAddress and *.domain A ipAddress) as well as a MX record pointing to mail.. Of course also the appropriate SPFDMARC and DKIM TXT records.
I have checked the postfix settings for both domains:
root@:/etc/postfix# find .|xargs fgrep 2>/dev/null
./sni_map:domainA /etc/ssl/virtualmin/171816738875815/ssl.key,/etc/ssl/virtualmin/171816738875815/ssl.cert,/etc/ssl/virtualmin/171816738875815/ssl.ca
./sni_map:.domainA /etc/ssl/virtualmin/171816738875815/ssl.key,/etc/ssl/virtualmin/171816738875815/ssl.cert,/etc/ssl/virtualmin/171816738875815/ssl.ca
./virtual:pws@domainA pws
./virtual:domainA domainA
./virtual:webmaster@domainA pws@domainA
./virtual:abuse@domainA pws@domainA
./virtual:hostmaster@domainA pws@domainA
./virtual:postmaster@domainA pws@domainA
./virtual:info@domainA info@domainA
I don’t see anything unusual here either?
I also searched through all config files in /etc on the new server and is never listed where I would not expect it to be?
Not sure how the maping works, I notices domains with web sites with letsencrypt map differently to with mail only, this may explain things.
ie with a webite enabled domain.com /home/domain.com/ssl.key,/home/domain.com/ssl.cert,/etc/ssl/virtualmin/166658752623322/ssl.ca
.domain.com /home/domain.com/ssl.key,/home/domain.com/ssl.cert,/etc/ssl/virtualmin/166658752623322/ssl.ca
without website enabled, I remember have a issue with the cert with this customer, I used the virtualmin main hostname for it to work, the ssl.key is not located at the domain.Maybe this is self-signed.
I did a test, on mail only account, I added it to Thunderbird and it doesn’t like the certificate but it does pickup the mail settings for the domain.
I enabled web and requested the Lets Encrypt cert.
I tried again to added the account to Thunderbird and certificate is excepted.
But the sni_map did not change location, must just updated the key, so that a red herring.
I get 404’s for both the line as you provided above, which I would have assumed is an example only as well as using my own domain name.
Maybe I am doing this all the wrong way round?
Doing the backups on the old VPS I never ticked the boxes to " Virtualmin settings to also backup". Is that my mistake? This would/could contain the mail server settings?
Plus at the new VPS I select the .tar.gz file when restoring a virtual server - correct?
OMG - I have done this for years and it never occurred to be to use the Virtualmin backup part…
Just done that backup and looks of what is actually saved etc. I think that might solve my problems.
I will now go and do a full backup-restore process - including the Virtualmin - and see how that reacts.
I will have to do some thinking about what will happen if I switch over the main domain name’s dns records, as that is the one containing mail. - which all my clients use.
I use a program called imapsync to keep the two vps in sync, but need to fine tune its settings before I fully commit.
So far thank you for getting my train back on the track.