Solved

Which db-files to copy from server to server?

Posted on 2006-11-01
4
282 Views
Last Modified: 2008-03-06
I would like to play with the backup from our original server.
Which files to copy?

my_db.mdf
my_db.idf

These as well?
mssqlsystemresource.mdf
mssqlsystemresource.idf

Are there more which I need to copy?
(Installations: both SQL Express adv)
0
Comment
Question by:joop123456
4 Comments
 
LVL 9

Accepted Solution

by:
dduser earned 250 total points
ID: 17856237
Take a backup from the server and then restore it to the new server. That would be the best way to do this.

Regards,

dduser
0
 
LVL 35

Expert Comment

by:Raynard7
ID: 17856242
Hi,

It is not advisable to use a file based backup for reasons please see http:Q_20912467.html "Simple File Based Backup"

below should give you some pointers on how to properly backup your data

http:Q_21710245.html "Proper SQL backup procedures"
http:Q_21698500.html "Backup and Recovery"
http:Q_21348116.html "Move databases files"

0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 17856253
I see .idf, but the transaction log files are usually .ldf.
to be sure which files to "copy" for a database, issue this query:

select * from my_db.dbo.sysfiles;

now, as noted above, to simply COPY the files will give you problems unless you first detached the database or shutdown the sql server before copying.
backup + restore is much simpler, and will ensure you get all the data.
0
 
LVL 11

Expert Comment

by:Goodangel Matope
ID: 17856474
I am a praranoid man, and as a result, I strongly recommend that you backup the database as follows:

Run this on the live server in query analyzer

BACKUP DATABASE <dbname> to disk = 'c:\dbbackup.bak'

copy c:\dbbackup.bak to your development server and run this statement in query analyzer on that server

RESTORE DATABASE <dbname> FROM DISK = 'c:\dbbackup.bak'

Wala!! very easy and safe!! :-)
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

930 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now