0

I am restore database sql server in linux and i have problem with the path, thing. My version of Sql Server is 2019 and version is develop.

I use:

sqlcmd -S localhost -U SA -Q "RESTORE DATABASE [prueba] FROM DISK = N'/var/opt/mssql/data/cliente.bak' WITH FILE = 1, NOUNLOAD, REPLACE, NORECOVERY, STATS = 5"

And the output is:

Msg 5133, Level 16, State 1, Server myserver, Line 1
Directory lookup for the file "F:\DATA\balmaceda\cliente.mdf" failed with the operating system error 2(The system cannot find the file specified.).
Msg 3156, Level 16, State 3, Server myserver, Line 1
File 'cliente' cannot be restored to 'F:\DATA\balmaceda\cliente.mdf'. Use WITH MOVE to identify a valid location for the file.
Msg 5133, Level 16, State 1, Server myserver, Line 1
Directory lookup for the file "F:\LOG\cliente\cliente_log.ldf" failed with the operating system error 2(The system cannot find the file specified.).
Msg 3156, Level 16, State 3, Server myserver, Line 1
File 'cliente_log' cannot be restored to 'F:\LOG\cliente\cliente_log.ldf'. Use WITH MOVE to identify a valid location for the file.
Msg 3119, Level 16, State 1, Server myserver, Line 1
Problems were identified while planning for the RESTORE statement. Previous messages provide details.
Msg 3013, Level 16, State 1, Server myserver, Line 1
RESTORE DATABASE is terminating abnormally.

1 Answers1

1

Finally i found the response in: DBeaver restore SQL Server .bak file

sqlcmd -S localhost -U SA -Q "RESTORE DATABASE [prueba2] FROM DISK = N'/var/opt/mssql/data/cliente.bak' WITH MOVE 'cliente' TO '/var/opt/mssql/data/cliente.mdf', MOVE 'cliente' TO '/var/opt/mssql/data/cliente.ldf'"