Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Back up

Author  Topic 

sgraves
Starting Member

29 Posts

Posted - 2008-06-16 : 10:42:41
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

385 Posts

Posted - 2008-06-16 : 10:48:43
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
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-06-16 : 14:15:22
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

676 Posts

Posted - 2008-06-17 : 17:29:35
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
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-06-17 : 17:39:14
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
   

- Advertisement -