Solved

Which db-files to copy from server to server?

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

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 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
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…
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

813 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

10 Experts available now in Live!

Get 1:1 Help Now