What is the best backup approach?

Thanks for the further comments. I do understand the argument regarding keeping the backup portable, however, for my needs this is not important as I’m just looking to backup and restore to the same environment.
Having said that, I appreciate your suggestions and maybe I will implement a mysql export, but then preferably an automated one (using an extra tool I guess) rather than manual, and as far as I’ve seen so far with Adminer I can’t do it automated.

In the meantime though I found a solution for backup and restore of the data of the container itself. It turns out that the devkinsta_db container is using a volume mount, which means that the data persists even if the container is removed. So restoring just the container is not going to do much at all as the data is not in the container itself.

In Windows 10 the data of the container can be found here (paste the path in explorer):
\wsl$\docker-desktop-data\version-pack-data\community\docker\volumes\devkinsta_db_data

I have tested backup and restore of the full content of this folder via Windows and this seems to work fine. When making a change in the db and then restoring the data (from before the change) I get back a working environment with the old (unchanged) data.
And this is of course also something that can be automated easily.
NOTE: the backup and restore steps should be done when the container is not running.

Having read your answers I’m not sure if you approve of the above approach but I thought I’d share it here as it does answer some of my initial questions and it does seem to work fine so far.

1 Like