Solved

Which db-files to copy from server to server?

Posted on 2006-11-01
4
281 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Join & Write a Comment

Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
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.

707 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

12 Experts available now in Live!

Get 1:1 Help Now