Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Which db-files to copy from server to server?

Posted on 2006-11-01
4
Medium Priority
?
296 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 9

Accepted Solution

by:
dduser earned 750 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 143

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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
When trying to connect from SSMS v17.x to a SQL Server Integration Services 2016 instance or previous version, you get the error “Connecting to the Integration Services service on the computer failed with the following error: 'The specified service …
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

715 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