Backup forces public directory

I'm not sure if this is a bug or intentional but you cannot create a backup only for the databases. It forces you to also select the public_html directory. If you don't it complains with an error. In my case I want to create a schedule that only exports the databases. Databases always exported full, regardless of the backup type which is fine with me. The problem with the current approach is that it makes backups huge and longer when all you require is the DB. You can set incremental but then again you are still duplicating unnecessary files if you already backup the rest of the files in a different backup schedule.

To resume, Virtualmin does not let you create a backup schedule only for the databases. I think this is even true for all selections in a backup. It seems you need to export the whole web directory regardless of the other options. You cannot only select 1 item, for example only DB, or only email. The current approach means backups take longer and you are duplicating files assuming you have multiple different schedules as each one requires the public directory to be included, ouch :(

Imagine if you have one backup only for emails, another just for databases, and another for something else. You now need to also have the complete WWW files on each one which is absolutely unnecessary. It increases backup times (and CPU) and backup space.

Lets us please create backups without having to also include the public_html directory on each schedule.

Status: 
Closed (fixed)

Comments

Howdy -- hmm, it should be possible to just backup a database.

Just to verify, in Backup and Restore -> Scheduled Backups -> SCHEDULE_NAME, what does the "Features and Settings" there look like?

It should be possible to do what you're after by selecting "Only those selected below...", and then only selecting one option at that point, "Contents of the server's MySQL databases".

If that's not working for you though, could you share a screenshot of how that screen looks in your case?

The problem is not with how the settings looks. You can certainly only select the option "Contents of the server's MySQL databases" and nothing else while creating a schedule. Then try to run a backup and it will fail with an error.

The error says the following: A new format backup can only be done when the home directory is included

If you go back and now also select the option "Server's home directory and web pages" then it works.

Of course this means the home directory is also included on each backup.

Please test this because unless you selected this last option you cannot run a backup.

Ah, that does ring a bell now.

I have a scheduled backup on my personal system doing exactly what you are asking for, though now that you mention it, I realized that I couldn't use the new backup format to do it.

What I did to backup just the database is select "One file per server (old format)" as the backup format. Would that do what you're after?

What is the difference while using that for backups?

I just used the default options and didn't selected the old format as I assumed the name "old" means its going to be deprecated or removed eventually.

Jamie, do you have any comment on the new vs old format in the backups, noting Comment #4 and #5 above?

The "old format" is less efficient if you are including the home directory, as it gets compressed twice. But it does allow more selective backups to be created.

Now I think about it, we should just hide this option and make it automatic.

So should I wait for an update or switch to the old format if I just want to dump the databases every day?

Switch to the old format - there's no downside to it.

Yeah it'll be a Virtualmin version or two before that's in there (so possibly a couple of months or more).

If you're interested in making backups with just MySQL databases, it's no problem to use the "old format", it's not going away, it's just a different format.

Ok. I will. I just thought it was strange the new format does not let you do selective backups and requires the home directory as well for backups.

Yeah, we will fix this.

A fix has been implemented for inclusion in the next release.

Status: Fixed (pending) ยป Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.