Perhaps the Wikibase Docker documentation should instruct to use mysqldump, mydumper or similar?
Using volume-backup for the database didn't work for me and I'm not sure if backing up and restoring by copying the files is even supposed to work with InnoDB tables. "But note that table file copying methods do not work if your database contains InnoDB tables." https://dev.mysql.com/doc/refman/8.0/en/backup-methods.html
(The symptom I got was an error telling me to run update.php when actually MySQL was rejecting all the tables in the my_wiki database and MySQL logs said I should run mysql_upgrade. I reverted to the previous version of the MariaDB docker image and it went to a restart loop logging some assertion errors.)