Reputation: 855
I'm running a container with MySQL 8.0.18 in Docker on a Synology nas. I'm just using it to support another container (Mediawiki) on that box. MySQL has one volume mounted at path /var/lib/mysql
. I would like to move that to a shared volume so i can access it with File Station and also periodically back it up. How can i move it to the docker
share shown below without breaking MySQL?
Here are available shares on the Synology nas.
Alternatively, is there a way i can simply copy that /var/lib/mysql to the shared docker folder? That should work as well for periodic backups.
thanks, russ
EDIT: Showing result after following Zeitounator's plan. Before running the docker command (2.) i created the mediawiki_mysql_backups
and 12-29-2019
folders in File Station. After running 2. and 3. all the files from mysql are here and i now have a nice backup!
Upvotes: 0
Views: 1244
Reputation: 44615
docker run -it --rm --name temp_mysql_copy -v mediaviki-mysql:/old-mysql -v /path/to/ttpe/docker:/new-mysql busybox:latest
cp -a /old-mysql/* /new-mysql/
/var/lib/mysql
(you probably need to do this in your syno docker gui).mediaviki-mysql
volumeUpvotes: 1