Solved

to move mdf and ldf files

Posted on 2010-08-23
13
541 Views
Last Modified: 2012-05-10
we have a mdf and ldf file of a database which is in Sql Server Express and I would like to move these files to the sql Server 2005 and want to use this database in Sql server 2005..how can we move these database to the sql server 2005?
0
Comment
Question by:teodor76
  • 8
  • 2
  • 2
  • +1
13 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 33499026
to move databases within a instance can also be done to move to another instance:
http://support.microsoft.com/kb/224071

note: you can only move to same or higher version, you cannot go backwards
0
 
LVL 19

Expert Comment

by:Bhavesh Shah
ID: 33499110

One more suggestion.
If u dont want to stop database then u can take backup and just restore in new server.
0
 
LVL 5

Expert Comment

by:ThakurVinay
ID: 33499237
just try to copy these mdf and ldf file to new server and try to attach. see if it works.
ELSE
just backup and resotre on new server.

HTH
Vinay
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 19

Expert Comment

by:Bhavesh Shah
ID: 33499295
You need to stop the server first.
then move datafiles.
0
 
LVL 19

Expert Comment

by:Bhavesh Shah
ID: 33499304

Sory....

For using attach & detach method, u no need to stop the server.
0
 
LVL 19

Expert Comment

by:Bhavesh Shah
ID: 33499305

Sory....

For using attach & detach method, u no need to stop the server.
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 33499309
>You need to stop the server first.
surely not. because if you stop the server and move the files, the original server will not know where his files are gone.
using detach method will make sure the server does know that they are no longer under it's responsibilities.

you could, of course, stop the server, and COPY the files ...
0
 

Author Comment

by:teodor76
ID: 33499553
I got the database file mdf and ldf with respect to database in sql Express and I copied them to the server on which sql server 2005 is installed..now I want to move them to the E:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data..in this case, should we need to stop MS Sql Service on the new server sql 2005 server?
0
 
LVL 19

Expert Comment

by:Bhavesh Shah
ID: 33499608
No....

you no need to stop.

You can directly moved.
0
 
LVL 19

Expert Comment

by:Bhavesh Shah
ID: 33499617
You need to stop server only if you are trying directly without detachig data files.
0
 
LVL 19

Expert Comment

by:Bhavesh Shah
ID: 33499621
You need to stop server only if you are trying to move data files directly without detachig data files.
0
 

Author Comment

by:teodor76
ID: 33499918
ok I copied them to the E:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data now how will I create this database on this server?
0
 
LVL 19

Accepted Solution

by:
Bhavesh Shah earned 250 total points
ID: 33499954

You no need to create database.

 Open your SQL SERVER MGMT STUDIO.
 Right click on database, select attach database. and give your mdf file name.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently, when I was asked to create a new SQL 2005 cluster, Microsoft released a new service pack for MS SQL 2005 what is Service Pack 3. When I finished the installation of MS SQL 2005 I found myself troubled why the installation of SP3 failed …
In SQL Server, when rows are selected from a table, does it retrieve data in the order in which it is inserted?  Many believe this is the case. Let us try to examine for ourselves with an example. To get started, use the following script, wh…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question