SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Back up
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

sgraves
Starting Member

29 Posts

Posted - 06/16/2008 :  10:42:41  Show Profile  Reply with Quote
I am trying to copy my database file so I can move it to another server. I found a file with .mdf file extention and a file with .ldf. Are these the files I need to copy?

They are stored in:

C:\Program Files\Microsoft SQL Server\MSSQL\Data

Thanks for any help.

Scott

jhocutt
Constraint Violating Yak Guru

USA
385 Posts

Posted - 06/16/2008 :  10:48:43  Show Profile  Visit jhocutt's Homepage  Send jhocutt an AOL message  Reply with Quote
Yes, but a safer way would be to back up the database and copy the .BAK file to the new server and do a restore.


"God does not play dice" -- Albert Einstein
"Not only does God play dice, but he sometimes throws them where they cannot be seen."
-- Stephen Hawking
Go to Top of Page

sodeep
Flowing Fount of Yak Knowledge

USA
7174 Posts

Posted - 06/16/2008 :  14:15:22  Show Profile  Reply with Quote
quote:
Originally posted by sgraves

I am trying to copy my database file so I can move it to another server. I found a file with .mdf file extention and a file with .ldf. Are these the files I need to copy?

They are stored in:

C:\Program Files\Microsoft SQL Server\MSSQL\Data

Thanks for any help.

Scott




Remember if you are detaching and attaching from SQL 2000 to SQL 2005 , by some reason you can't attach to SQL 2005 , you can't go back to SQL 2000 and attach.

So go with backup/Restore.
Go to Top of Page

tosscrosby
Aged Yak Warrior

USA
676 Posts

Posted - 06/17/2008 :  17:29:35  Show Profile  Reply with Quote
Or stop the SQL services and COPY the .mdf, .ndf and .ldf files, leaving the originals intact on the source server, and then sp_attach_db on the new server. I don't necessarily agree that a backup/restore is any safer but I do agree with jhocutt about backing up the databases - PRIOR to doing anything.

Terry

Edited by - tosscrosby on 06/17/2008 17:31:13
Go to Top of Page

tkizer
Almighty SQL Goddess

USA
37287 Posts

Posted - 06/17/2008 :  17:39:14  Show Profile  Visit tkizer's Homepage  Reply with Quote
The reason why backup/restore is safer is because you haven't modified the source database. When you use the detach/attach method, you are modifying the source database. What happens if you can't attach it back? With backup/restore, you don't have that risk.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000