sql server database file transfer from one machine to another

Hi,

I had to recreate a SQL Server 2005 Database instance on another machine. I wasn't having an option to take DB offline and copy the ldf and mdf files. Hence I took a back-up of the database (.bak) file -> copied it to another machine back-up folder and then restored it.

Is this process equivalent to creating a new instance on another machine OR is there any catch ?
pratz09Asked:
Who is Participating?
 
Ephraim WangoyaConnect With a Mentor Commented:

The actions are equivalent.

When you restore the database it actually creates the files again (mdf and ldf), If you did not select a location then it just created the files in the default location eg
C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA



0
 
Ephraim WangoyaCommented:

You already created the instance as you pointed out
For the database however, you have just created a copy of it without any latest changes (IE the changes that were made since you did the backup)
0
 
pratz09Author Commented:
Yea, I wanted to replicate the database (till the point in time I took the back-up) on another machine, which is actually a development machine. Can I sync both databases easily ?
0
 
pratz09Author Commented:
I am sorry for not making the question clear. What I meant to ask was whether recreating an instance of database via back-up file of original database is equal to creating a new database on another machine and copying ldf and mdf files in it.

One difference which I can see is that when I create a new database on target machine usign solution explorer, it creates 2 files newDB and newDB_log, while it doesn't happen if i restore a database usign .bak file. I am not how much difference does it make, hence I thought to confirm it here.
0
 
pratz09Author Commented:
Thanks for confirming. I believe newDB_log file is not that important.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.