postfix main.cf bug in the Virtualmin backup/restore process

Support,

I found a postfix main.cf bug in the Virtualmin backup/restore process.

I used the following bash shell command on the old server:

# virtualmin backup-domain --dest /backup/full/ --all-domains --all-features --newformat --all-virtualmin

and ran the following command on the new server:

# virtualmin restore-domain --source /backup/full/virtualmin.tar.gz --all-virtualmin
# virtualmin restore-domain --source /backup/full/ --all-domains --all-features

GOOD NEWS: The entire backup/restore went perfectly.

BAD NEWS: The restore command *also* changed the new server /etc/postfix/main.cf file.

Instead of my new server having these lines:

myhostname = server.newserver.com
mydestination = newserver.com, server.newserver.com, localhost.newserver.com, localhost

it was changed to this:

myhostname = server.oldserver.com
mydestination = oldserver.com, server.oldserver.com, localhost.oldserver.com, localhost

So all my email started bouncing with the "looping back onto itself" errors.

Status: 
Active

Comments

Was oldserver.com or newserver.com one of the domains in the backup?

No, but close...

The actually domains were like this:

www.domain1.com www.domain2.com

On domain2.com, there was a virtual server called domain3.com

When domain2.com was restored to domain1.com (migrating domain3.com with it) then I had the domain3.com in the /etc/postfix/main.cf file instead of domain1.com

Actually, I see the issue here - if you use the --all-virtualmin flag, the backup will contain the Postfix configuration as well, which meansmain.cf and master.cf . This is useful if you want to create a backup for restoring locally, but as you saw it may cause problems when restoring on a new machine.

The solution is to limit the global settings you want to backup. Instead of the --all-virtualmin flag, you could instead use :

--virtualmin config --virtualmin templates --virtualmin resellers --virtualmin email --virtualmin custom --virtualmin scripts --virtualmin styles --virtualmin scheds --virtualmin chroot

Where can I find a list of all possible "--virtualmin ???" options? I tried HELP, but it only listed "config".

Oh, I found them, had to put in a bad --virtualmin jjj and it printed the options.

For the GPL version, options are:

config templates email custom scripts scheds chroot mailserver

Thx!

The ones he mentioned above are 9 out of the 10 available --virtualmin options.

The only one he left out was "--virtualmin mailserver", but that's not one you'd want to use in this case.