I'm having trouble restoring a .bak file while moving it from laptop A to laptop B. First, on A, I backed up the 'Staging' db, creating the Staging.bak file which I transferred to laptop B. I restored (or thought I did) the .bak on B but it doesn't show
up on my list of B's Databases even after refreshing and restarting SQL Server.
Second, I then tried with T-SQL as below and got the error shown. I'm specifying a path with '\Program Files' and the error msg refers to 'Program Files (x86)' which, on my machine, doesn't have the subdir's listed in the err msg. Those dir's are part of the
\Program Files path (and this is also the 'Data Path' listed in SQL Server Config Mgr). I'm running SQL Server 2014 Express on Windows 8.1.
RESTORE DATABASE Staging FROM DISK = 'C:\Program Files\Microsoft SQL Server\MSSQL12.SQLEXPRESS\MSSQL\Backup\Staging.bak' ;
Msg 5133, Level 16, State 1, Line 1 Directory lookup for the file "C:\Program Files (x86)\Microsoft SQL Server\MSSQL12.SQLEXPRESS\MSSQL\DATA\Staging.mdf" failed with the operating system error 3(The system cannot find the path specified.). Msg 3156, Level 16, State 3, Line 1 File 'Staging' cannot be restored to 'C:\Program Files (x86)\Microsoft SQL Server\MSSQL12.SQLEXPRESS\MSSQL\DATA\Staging.mdf'. Use WITH MOVE to identify a valid location for the file. Msg 5133, Level 16, State 1, Line 1 Directory lookup for the file "C:\Program Files (x86)\Microsoft SQL Server\MSSQL12.SQLEXPRESS\MSSQL\DATA\Staging_log.ldf" failed with the operating system error 3(The system cannot find the path specified.). Msg 3156, Level 16, State 3, Line 1 File 'Staging_log' cannot be restored to 'C:\Program Files (x86)\Microsoft SQL Server\MSSQL12.SQLEXPRESS\MSSQL\DATA\Staging_log.ldf'. Use WITH MOVE to identify a valid location for the file. Msg 3119, Level 16, State 1, Line 1 Problems were identified while planning for the RESTORE statement. Previous messages provide details. Msg 3013, Level 16, State 1, Line 1 RESTORE DATABASE is terminating abnormally.