Does Duplicati support MySQL / MSSQL server database backups?

MySQL / MSSQL can produce database backups to the local disk using built in tools. How to make Duplicati backup those backup files to the remote server?

Is it possible to run pre-backup scripts to backup the SQL databases and then send them to the remote server?

Basically, How to do SQL backups with Duplicati? Thank you.

1 Like

Duplicati currently only supports MSSQL databases.

Run Duplicati on the MSSQL server create a new backup task, under sources you should see MSSQL.

Run Duplicati as admin or service if you can’t see MSSQL under sources.

1 Like

You can also make backups of MySQL, but you need to make it flush the buffers before the VSS snapshot is started:

1 Like

Do you meant that I can simply make MySQL flush the buffers first and then backup the MySQL’s /data folder using Duplicati?

Wouldn’t be easier using mydumper or/and a script before running duplicati?

1 Like

Doable for sure :slight_smile: I guess that Duplicati has some built in configuration option to set a pre- backup script. I will check that later.

That is what I do. A small bash script that calls mysqldump is run using the --before-script (I think that’s the option flag) flag. I also ended up increasing the script timeout.

2 Likes

Is MYSQL support in road map?

You can back it up using a Duplicati pre-backup script that dumps the database to regular flat files, then you back up the dump folder with Duplicati.

Thanks, How can i have the small bash script that calls mysqldump, On windows? Any tutorial?

There’s another recent thread where this same thing is being discussed… check it out:

1 Like

So if you need to create an MS SQL backup you just need to check the appropriate database from the sources and you are care-free for flushing buffers etc?

Aren’t there any extra options involved apart from snapshot policy → required to be sure that the backup is taken correctly?

This can work even with duplicati and MSSQL Server running in 2 different containers?

I don’t use anything remotely similar to this, but I’ll say that I doubt it and also ask some questions.

Microsoft Gives Up on Running SQL Server in a Windows Container raises configuration question.
What sort of container, with what OS inside? I think the backup is by snapshot from Windows VSS.
SQL Server Backup Applications - Volume Shadow Copy Service (VSS) and SQL Writer

Without that, there might be some other way, provided one container can get to the files of another.
Containers typically provide file isolation, which typically can be administratively configured around.
You’d probably have to use some non-VSS methods to get a stable set of files for Duplicati backup.

I’m using the official microsoft docker images that are based on Ubuntu

That likely clinches the idea that you won’t be able to do VSS-based backups. Maybe another type.
Duplicati scripting options might help prepare files from database before the actual backup is done.

In teory I can run a script to execute a query to create the backup files from sql server, the problem it’s how to execute sqlcmd from the duplicati container

Because I don’t use containers, and I don’t know if a container wizard will stop by, Google might help.

SQLCMD cannot connect to SQL instance (Container to Container) doesn’t quite fit because sqlcmd wouldn’t be in the Duplicati container, by default at least. Containers unfortunately seem kind of fixed.

How to execute command from one docker container to another is a more generic version of question.

Tools outside the container covers how to get in, but I haven’t found where MS talks about getting out, though container-to-container seems like a reasonable setup once you’re on containers. Not my area.

Could going in from the host to both containers via docker exec coordinate things across them both?

I don’t see MSSQL in the source list, Where do I see it? Can someone post a screenshot?

Thanks in advance!