Showing posts with label location. Show all posts
Showing posts with label location. Show all posts

Tuesday, March 20, 2012

Restoring master to a different location

I am trying to restore master to a new server but location of data and log files is different in this new server. The previous location was 'D:\Program Files\Microsoft SQL Server\MSSQL\data\" the current location is in the C: Drive; when trying to restore using MOVE:

RESTORE DATABASE master FROM DISK ='\\Pfileserver\sqlbackup\MDFfiles\master_db_20070 8170121.BAK' WITH RECOVERY ,
MOVE 'master' TO 'C:\Program Files\Microsoft SQL Server\data\master.mdf',
MOVE 'mastlog' TO 'C:\Program Files\Microsoft SQL Server\MSSQL\data\mastlog.ldf'

I get the following error message:

The system database cannot be moved by RESTORE

Is there a way you can restore master to a different location?

Thanks,

Carloshttp://support.microsoft.com/kb/224071/EN-US/

Please let know whether this info is useful.

thanks

Restoring master to a different location

I am trying to restore master to a new server but location of data and log
files is different in this new server. The previous location was 'D:\Program
Files\Microsoft SQL Server\MSSQL\data\" the current is in the C: Drive when
trying to restore using MOVE:
RESTORE DATABASE master FROM DISK
='\\Pfileserver\sqlbackup\MDFfiles\master_db_200708170121.BAK' WITH RECOVERY ,
MOVE 'master' TO 'C:\Program Files\Microsoft SQL
Server\data\master.mdf',
MOVE 'mastlog' TO 'C:\Program Files\Microsoft SQL
Server\MSSQL\data\mastlog.ldf'
I get the following error message:
The system database cannot be moved by RESTORE
Is there a way you can restore master to a different location?
Thanks,
CarlosHi Carlos
http://support.microsoft.com/kb/304692/ describes how to restore a master
database
John
"Carlos" wrote:
> I am trying to restore master to a new server but location of data and log
> files is different in this new server. The previous location was 'D:\Program
> Files\Microsoft SQL Server\MSSQL\data\" the current is in the C: Drive when
> trying to restore using MOVE:
> RESTORE DATABASE master FROM DISK
> ='\\Pfileserver\sqlbackup\MDFfiles\master_db_200708170121.BAK' WITH RECOVERY ,
> MOVE 'master' TO 'C:\Program Files\Microsoft SQL
> Server\data\master.mdf',
> MOVE 'mastlog' TO 'C:\Program Files\Microsoft SQL
> Server\MSSQL\data\mastlog.ldf'
> I get the following error message:
> The system database cannot be moved by RESTORE
> Is there a way you can restore master to a different location?
> Thanks,
> Carlos

Tuesday, February 21, 2012

Restoring database to a different name and location

Can someone please tell me what's wrong with my script below? I am trying to restore a database backup to a different database name and location.

RESTORE DATABASE test
FROM 'C:\mybackup.bak'
WITH MOVE 'h_data' TO 'C:\Program Files\SQL2000\MSSQL\Data\Test_data.mdf'

Thanks

SHKWhat error are you getting?

I do the following

ALTER DATABASE TaxReconDB_Prod SET SINGLE_USER WITH ROLLBACK IMMEDIATE

RESTORE DATABASE TaxReconDB_Prod
FROM DISK = 'D:\Tax\BackUp\TaxReconDB.dmp'
WITH MOVE 'TaxReconDB_Data' TO 'D:\Database\NJROS1D151DEV\MSSQL$NJROS1D151DEV\Dat a\TaxReconDB_Prod_Data.MDF'
, MOVE 'TaxReconDB_Log' TO 'D:\Database\NJROS1D151DEV\MSSQL$NJROS1D151DEV\Dat a\TaxReconDB_Prod_Log.LDF'
, REPLACE|||The error said that I have a syntax error on line 2.

I tried

FROM DISK = 'C:\Mybackup.bak"

and I got an error "Cannot open backup device", which makes sense because the backup is not from a disk.

then I tried

FROM FILE = 'C:\MyBackup.bak"

and I got a syntax error.

Help. I am not familiar with restoring database at all.

Thanks

SHK|||The following is correct:

FROM DISK = 'C:\Mybackup.bak"

As you are getting "Cannot open backup device", looks like you have mispelled the file name or missed a blank or something...check again|||Check the ending double quote:::
FROM DISK = 'C:\Mybackup.bak"|||I double checked and the spelling is correct.

It is a single quote at the end of the FROM DISK.

I am out of ideas.

SHK|||Ok, do this

RESTORE FILELISTONLY FROM DISK = 'C:\...'

btw where is the back up file physically at?

What happend when you run

master..xp_cmdshell 'DIR C:\*.bak'

What do you see?|||I got it to work.

I copied the backup from the network to my C drive and wanted to restore the backup to my MSDE 2000. I was trying to run the script from the network when I got all those errors. I was playing around and figured that maybe I could try to run the script locally and there it ran.
I guess the script failed because the backup was on my C drive and I tried to run it from the network server.

Thanks for all the suggestions and helps.

SHK