?
Solved

How to copy/attach mdf to new installation

Posted on 2010-11-17
4
Medium Priority
?
724 Views
Last Modified: 2012-05-10
I just published my first application in VB.NET and installed it on a new machine.  The database was created in SQLExpress 2008.  How do I copy the database to the new machine and attach it to SQL Server there?  Does it matter which version of SQL Server I use on the new machine?  When I try to copy the physical file, I get an error that it is being used by another person or program, although I  have everything shut down.  Help!

Thank you in advance!
0
Comment
Question by:Agent909
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 2

Accepted Solution

by:
marceloOrigoni earned 2000 total points
ID: 34161732
It's better if you perform a backup of the database (right click over the database -> Tasks -> backup), if you still want to copy the mdf itself (which I do not recommend), you'll need to dettach the database before copying the file.
 then you can copy the mdf file, and attach it to your new server. You don't need to worry about the log file(ldf), since if it doesn't, sql server will create again.
 It does matter which version of mssql server you are using, unless you created the db as version 9 (server 2005), you won't be able to install it on sql server 2005, same applies with version 8 and sql server 2000. If you have a sql server 2008 installed on your new machine (it doesn't matter if it's express or professional).

 Best

 Marcelo
0
 
LVL 1

Author Comment

by:Agent909
ID: 34161746
Thank you for your quick answer.  How do I detach the mdf?
0
 
LVL 1

Author Comment

by:Agent909
ID: 34161758
I just figured out how to detach it, and I also backed it up.  How do I attach it to the new SQL Server?
0
 
LVL 1

Author Closing Comment

by:Agent909
ID: 34161847
Thank you for your help!
0

Featured Post

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!

Question has a verified solution.

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

There have been several questions about Large Transaction Log Files in SQL Server 2008, and how to get rid of them when disk space has become critical. This article will explain how to disable full recovery and implement simple recovery that carries…
In this article I will describe the Detach & Attach method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

765 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