Last active
January 21, 2020 09:33
-
-
Save ivuorinen/e23f53cffe37a0025986b6b9e647310b to your computer and use it in GitHub Desktop.
Docker MSSQL Database: Copy backup to container
This file contains hidden or 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
# Run these as root or prefix with sudo on the Docker host machine | |
# $MACHINE = Container ID, or part of it. | |
# Usually 3 first chars are enough. Get it with `docker ps|grep mssql-server` | |
# Create backup folder | |
docker exec -it $MACHINE mkdir /var/opt/mssql/backup | |
# Copy backups to the machine | |
docker cp backup.bak $MACHINE:/var/opt/mssql/backup | |
# Might work, haven't tried | |
docker cp */**/*.bak $MACHINE:/var/opt/mssql/backup | |
# Then import them in SQL Server Management Studio, or your preferred way |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment