Backup and Restore with Docker Compose

All of my data is on folder drive mounts that where our data is to make backup and restore operations easier. Stopping your stack with docker-compose down will allow you to back up all the files and subfolders in the folder next to the docker-compose.yml file.

For example, if you want to create a ZIP archive, you can use the following command:

zip -r myarchive.zip .

To restore from a ZIP archive, please unzip the archive into the original folder using the following command.

unzip myarchive.zip -d /path/to/original/folder

Once your backup has been completed, you can start your stack again with the following command:

docker-compose up -d

This is all. With these simple steps, you can easily backup and restore your data volumes with Docker Compose.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.