Estou usando o SQL Server 2019 Developer em Docker.
Tentei com os bancos AdventureWorks2014, AdventureWorks2017 e AdventureWorks2019
Copiei os arquivos para o volume do docker onde está as outras tabelas: /var/opt/mssql/data/AdventureWorks2017.bak
Ao tentar executar (tanto via interface gráfica quanto via script o erro é o mesmo). Segue o script:
USE [master]
RESTORE DATABASE [AdventureWorks2017]
FROM DISK = N'/var/opt/mssql/data/AdventureWorks2017.bak'
WITH FILE = 1
, MOVE N'AdventureWorks2017' TO N'/var/opt/mssql/data/AdventureWorks2017.mdf'
, MOVE N'AdventureWorks2017_log' TO N'/var/opt/mssql/data/AdventureWorks2017_log.ldf'
, NOUNLOAD, STATS = 5
GO
Segue o Erro:
Msg 3634, Level 16, State 1, Line 2
The operating system returned the error '2(The system cannot find the file specified.)' while attempting 'RestoreContainer::ValidateTargetForCreation' on '/var/opt/mssql/data/AdventureWorks2017.mdf'.
Msg 3156, Level 16, State 5, Line 2
File 'AdventureWorks2017' cannot be restored to '/var/opt/mssql/data/AdventureWorks2017.mdf'. Use WITH MOVE to identify a valid location for the file.
Msg 3634, Level 16, State 1, Line 2
The operating system returned the error '2(The system cannot find the file specified.)' while attempting 'RestoreContainer::ValidateTargetForCreation' on '/var/opt/mssql/data/AdventureWorks2017_log.ldf'.
Msg 3156, Level 16, State 5, Line 2
File 'AdventureWorks2017_log' cannot be restored to '/var/opt/mssql/data/AdventureWorks2017_log.ldf'. Use WITH MOVE to identify a valid location for the file.
Msg 3119, Level 16, State 1, Line 2
Problems were identified while planning for the RESTORE statement. Previous messages provide details.
Msg 3013, Level 16, State 1, Line 2
RESTORE DATABASE is terminating abnormally.