Excluding mysql from backup restore seems to have no effect

I run the following command:

/usr/libexec/webmin/virtual-server/restore-domain.pl --source s3://$AWS_ACCESS_KEY_ID:$AWS_SECRET_ACCESS_KEY@$bucket --all-domains --all-features --all-virtualmin --except-feature mysql

Which results in the following:

--------

Checking for missing features ..
.. all features in backup are supported

Starting restore..
Downloading archive from Amazon S3 server ..
.. done

Extracting backup archive files ..
.. done

Re-creating virtual server xxxxremovedxxxxx.com ..
.. a clash was detected : A MySQL database called definedpurpose or user called xxxremovedxxxx already exists

Restoring Virtualmin settings (Module configuration, Server templates, Reseller accounts, New mailbox email messages, Custom fields, links and shells, Third-party script installers, Third-party content styles, Scheduled Virtualmin backups) ..

.. done

Restore failed!

--------

The restore script still tries to import the MySQL data. Am I doing something daft?

Background info: The MySQL databases do not need restoring as they are stored on an EBS device, so the MySQL databases persist between EC2 instance reboots.

Thanks!

Adam

PS. Really sorry for all the tickts, they should die down soon, I promise!

Status: 
Closed (fixed)

Comments

eugenevdm.host's picture
Submitted by eugenevdm.host on Sun, 01/19/2020 - 02:59

This flag is still ignored:

-all-virtualmin --except-feature mysql

and since there is no ignore-errors flag batch restores are problematic in a MySQL replication environment where databases already exist.

We can certainly look into that, though since this request is 12 years old, could you start a new bug report?

It's likely a different issue now, though even if not it'd be good to start fresh. Thanks!

eugenevdm.host's picture
Submitted by eugenevdm.host on Tue, 01/21/2020 - 08:52

Hi @andreychek,

After banging my head for an hour I found this is the combination of flags that work:

--all-domains --all-features --except-feature mysql --only-features --only-missing

The key being --only-features. It appears --except-feature doesn't work unless you have --only-features

The --only-features flag will limit restored and re-created domains to the features that were included in the backup. Without it, the re-created domains will still have MySQL enabled, but the contents of any DBs won't be restored.