Quantcast
Channel: Forum SQL Server Database Engine
Viewing all articles
Browse latest Browse all 15889

SQL Server fails to start after copying the DATA folder

$
0
0

I cannot copy the DATA folder from one computer to another. I am using SQL Server 2012 x64 Developer running on Windows 8 booted from a VHDX. The VHDX is mounted as C drive, and is contained in D drive which is the physical disk. The workaround is to perform an extra step by rebuilding the system databases described in article http://msdn.microsoft.com/en-au/library/dd207003.aspx then copying the contents of the DATA folder from one computer to another, instead of copying the DATA folder itself.

The exact steps to reproduce this problem is:
* copy the DATA folder in D:\Program Files\Microsoft SQL Server\ into a new folder called "DATA - Copy"
* delete "DATA" and rename "DATA - Copy" to "DATA"
* start the SQL Server service.

I get the error message "SQL Server Configuration Manager - The request failed or the service did not respond in a timely fashion. Consult the event log or other applicable error logs for details."

The Event Log shows the message below:

The SQL Server (MSSQLSERVER) service terminated with the following service-specific error:
WARNING: You have until SQL Server (MSSQLSERVER) to logoff. If you have not logged off at this time, your session will be disconnected, and any open files or devices you have open may lose data.
Source: Service Control Manager
Event ID: 7024

The steps to workaround this problem is:
* rebuild the system database so that SQL Server has a working DATA folder. I use the command "Setup /QUIET /ACTION=REBUILDDATABASE /INSTANCENAME=MSSQLSERVER /SQLSYSADMINACCOUNTS=[accounts] /SAPWD=[password]"
* delete all files in the rebuilt DATA folder
* copy all files from the original DATA folder to the rebuilt DATA folder

The workaround is inconvenient because I cannot simply copy the entire D drive from one computer to another without additional steps. I use D drive to store all my data. The Program Files is in C drive inside the VHDX.

Can you advise a better solution for copying the DATA folder as part of copying the entire drive? I am aware of re-imaging software like Macrium Reflect Free but prefer to just copy the entire D drive from one computer to another.


Viewing all articles
Browse latest Browse all 15889

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>