Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 back upwith out any machine specific data

Author  Topic 

sujithukvl@gmail.com
Starting Member

22 Posts

Posted - 2007-06-25 : 09:44:18
How can i take back up of a data base
with out having any machine/system specific
data in the .bak file?

Wanderer
Master Smack Fu Yak Hacker

1168 Posts

Posted - 2007-06-25 : 10:06:40
What do you mean? A database backup per se doesn't have machine specific data - you can backup on serverA, and restore on LaptopB. You will have issues around users, which are linked to logins, and logins are mahcine specific. Not much you can do there, but drop users on laptopB, or run sp_change_users_logins autofix (check syntax in BOL)


*##* *##* *##* *##*
Chaos, Disorder and Panic ... my work is done here!
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-06-25 : 10:10:11
maybe he's thinking about mdf and ldf file paths

you could script your complete db
and create insert statements for all your data.


_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
Go to Top of Page

sujithukvl@gmail.com
Starting Member

22 Posts

Posted - 2007-06-25 : 10:13:03
then why i cant restore a db ,in another system

i am getting error like




System.Data.SqlClient.SqlError: Directory lookup for the file "D:\Microsoft SQL Server 2005\mydatabase.mdf" failed with the operating system error 2(The system cannot find the file specified.). (Microsoft.SqlServer.Smo)



i am trying to restore from a .bak file
Go to Top of Page

sujithukvl@gmail.com
Starting Member

22 Posts

Posted - 2007-06-25 : 10:15:45
i have only back file
no any other files on the target system
Go to Top of Page

Wanderer
Master Smack Fu Yak Hacker

1168 Posts

Posted - 2007-06-25 : 12:40:16
how are you trying to restore? Via QUI, or SQL script?

Useing SQL script, try the following:

Restore Database <YourDBName>
From Disk = 'fullpath to you backup file'
with move '<data file name>' to 'full path where you want mdf to reside',
with move '<log file name>' to 'full path where you want ldf to reside'

--for example:
Restore Database MYDB
from disk = 'c:\temp\serverdb.bak'
with move 'ServerDBDataFile' to 'd:\data\mydb.mdf',
with move 'ServerDBLogFile' to 'd:\Log\mydb.ldf'

--If you don't know the logical file name,s, then use restore filelistonly from the backup: eg
Restore FileListOnly
from disk = 'c:\temp\serverdb.bak'
--then copy the logical file names to the SQL


I'll leave it to someone else to describe this in QUI - I generally avoid GUI if I can

*##* *##* *##* *##*
Chaos, Disorder and Panic ... my work is done here!
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-06-25 : 13:28:32
You have already asked this question here:

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=85491

where I have already replied!
Go to Top of Page

sujithukvl@gmail.com
Starting Member

22 Posts

Posted - 2007-06-27 : 01:53:42
thanks to both
Go to Top of Page
   

- Advertisement -