Skip to content

Instantly share code, notes, and snippets.

@Guidhouse
Created March 31, 2020 20:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Guidhouse/17ffdfea3c83cc6df7fe725eee562d61 to your computer and use it in GitHub Desktop.
Save Guidhouse/17ffdfea3c83cc6df7fe725eee562d61 to your computer and use it in GitHub Desktop.
Restore to SqlServer on Docker
USE [master]
--Get logical names first
EXEC sp_restore_filelistonly
@device_type = 'DISK',
@backup_path = '/var/opt/mssql/data/DB.bak'
--Then restore
RESTORE DATABASE MarcRecordsDB
FROM DISK = '/var/opt/mssql/data/DB.bak'
WITH MOVE 'DB' TO '/var/opt/mssql/data/DB.mdf',
MOVE 'DB_log' TO '/var/opt/mssql/data/DB_log.ldf'
--STATS = 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment