This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Backup DB | |
docker exec CONTAINER /usr/bin/mysqldump -u USERNAME --password=PASSWORD DATABASE > backup.sql | |
Restore DB | |
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u USERNAME --password=PASSWORD DATABASE | |
Backup named volume | |
docker run --rm --volumes-from CONTAINER -v $(pwd):/backup debian tar cvf /backup/archive.tar /volume/location | |
Restore named volume |