Moving a SQL database to a new computer

Peter Fuzessery of Miad has sent this information to me to pass on for any other AyaNova usersthat also encounter the need to move their SQL AyaNova database from one computer to a new computer. I think this is great and encourage others to do so.

.

I installed SQL Express as per your instructions in the manual.

On old server, I disabled the SQL Express Service and the Server Browser.

I then copied the Ayanova.mdf and the Ayanove_log.ldf file to the new server.

For me the default location was c:\program files\microsoft sql server\mssql.1\mssql\data\ in both locations.

On the new server I went to a command prompt and ran sqlcmd -S server2\sqlexpress (server2 is my servername and sqlexpress was the instance )

I determined the instance in the properties on the server…see attached image below.

I then got a 1) prompt and typed the following 7 lines followed by a return after each and don’t forget the spaces.

Use [master]
Go
Create database [ayanova] on
( filename = N’c:\program files\microsoft sql server\mssql.1\mssql\data\ayanova.mdf’ ),
<- don’t forget the apostophe ending ‘ after f
( filename = N’c:\program files\microsoft sql server\mssql.1\mssql\data\ayanova_log.ldf’ ) <- don’t forget the apostophe ending ‘ after f
For attach ;
Go

I then got a 1) prompt and types quit.

I then carried on with the ayanova modifications to use on workstations and all was well.