Is Kopia suitable for backing up MySQL database?

And, is it a problem if backup happens while the database is in use?

The question should be “How does MySQL handle it?”, after restoring a backup that’s been made this way it will be similar to MySQL being SIGKILL’ed or a power outage of the machine.
So the answer is “It’s not ideal.”
You could run job every X hours to dump the database and backup the dump with Kopia.

1 Like

Thanks for the insight. I should have thought of this…
Welcome among us!

Unfortunately, this would not work because Kopia would not be able to read a consistent view (all at once) of the MySQL data files, and thus, it is not equivalent to a hard shutdown. For this, snapshotting support from either the file system, the storage system / device is needed. See 2. below.
Side note: MySQL performs a “crash restore” every time it starts up, so at a high level, it is no different whether the MySQL shutdown is a clean or a dirty one.

  1. You could also look into tools such as Percona XtraBackup to perform incremental backups, and then use Kopia to backup the resulting incremental backup files.

  2. Alternatively, if the storage system (used for the the MySQL data directory) allows taking and accessing consistent snapshots, you can take a snapshot of the file system and then use Kopia to backup the snapshot.