Cannot Copy Database [closed]

Posted on

Question :

I am working with SQL server 2012. I want to copy a database along with all the data. I just want to create a dev DB.

I know SQL Server 2012 has a Copy Database… wizard. But when I run that wizard, I get an error on the last step:

enter image description here

On error, it tells me that error log in inside a text file on the shown path. When I go to that path, there is no such file there.

I tried backup and then restore with a different name as well. But it gave similar results. I got error while restoring. But I couldn’t find the error log file.

Can anyone please help me with this?

Answer :

These are the steps of the SQL Agent Job: detach the database, copy MDF and LDF files to the destination, then attach both source and destination to their respective instances.

It is possible that there was something preventing the detach.
You cannot detach a database that is replicated/published.
A database snapshot exists on the database.
It is being mirrored.
It is suspect.
It is a system database.

There could have been an issue with permissions copying the MDF and LDF files (not your login, but the SQLAgent service account login).

There could have been an issue with the attach.
A database created by a more recent version of SQL Server cannot be attached in earlier versions.

For the non-existent log file: Ensure write permissions for the account that runs SQLAgent service on the folder where the log of the error would be written.

I had to do it the other way. I created an empty DB and used import wizard to import all the data and the schemas. This worked without any error. But I still don’t know why the Copy Wizard didn’t work.

Leave a Reply

Your email address will not be published. Required fields are marked *