2
I am very beginner in SQL Server and am trying to import a file . Bak from a backup that came from another server (Windows) on Linux (Linux Mint 19)
The command I used in the terminal was that:
sqlcmd -S localhost -U SA -Q "RESTORE DATABASE [demodb] FROM DISK = N'/home/usuario/html/projeto_sql/backup.bak' WITH FILE = 1, NOUNLOAD, REPLACE, STATS = 5"
The mistakes are:
Msg 5133, Level 16, State 1, Server homepc, Line 1
Directory lookup for the file "E:\Banco Dados\Banco1.mdf" failed with the operating system error 2(The system cannot find the file specified.).
Msg 3156, Level 16, State 3, Server homepc, Line 1
File 'Banco1' cannot be restored to 'E:\Banco Dados\Banco1.mdf'. Use WITH MOVE to identify a valid location for the file.
Msg 5133, Level 16, State 1, Server homepc, Line 1
Directory lookup for the file "E:\Banco Dados\Banco1_log.ldf" failed with the operating system error 2(The system cannot find the file specified.).
Msg 3156, Level 16, State 3, Server homepc, Line 1
File 'Banco1_log' cannot be restored to 'E:\Banco Dados\Banco1_log.ldf'. Use WITH MOVE to identify a valid location for the file.
Msg 3119, Level 16, State 1, Server homepc, Line 1
Problems were identified while planning for the RESTORE statement. Previous messages provide details.
Msg 3013, Level 16, State 1, Server homepc, Line 1
RESTORE DATABASE is terminating abnormally.
OBS:
My version of SQL SERVER running is
Microsoft SQL Server 2017 (RTM-CU13) (KB4466404) - 14.0.3048.4 (X64) Nov 30 2018 12:57:58 Copyright (C) 2017 Microsoft Corporation Developer Edition (64-bit) on Linux (Linux Mint 19.1)
I don’t know which version of SQL Server/ or how the file . Bak was created, it matters?
I come from Mysql, there is some kind of file . sql that can be created or SQL Server backup needs several files and not only . Bak?
Installing SQL Server 2017 for Linux was via Docker?
– José Diz
No, I installed following the manual on microsoft website same
– Thiago