Running Microsoft SQL Server 2012. I am trying to copy a database called uktech to a new database called catech, on the same SQL server.
catech database does not exist. I did a "copy only" full backup of uktech, file is called uktech_full.bak
I am using a query that has worked before in this type of scenario, but today I am getting an error. Here is my query:
RESTORE DATABASE catech
FROM DISK='C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Backup\uktech\uktech_full.bak'
MOVE 'uktech' TO 'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\catech',
MOVE 'uktech_log' TO 'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\catech_log',
Here is the error:
Msg 3234, Level 16, State 2, Line 1
Logical file 'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\uktech' is not part of database 'catech'. Use RESTORE FILELISTONLY to list the logical file names.
Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.
Since I didn't write that query originally, I'm not sure what is wrong with it today. Yes, the error is correct that that file is not part of the database catech. But I am trying to copy its entire database structure and records to a new database, and I know this has worked before.