Monday, March 26, 2012

Restore to different server

If I am restoring a database from a backup file on disk on Server_A to a
database on Server_B, in the restore syntax do I need to specify the "with
move" clause if the data and log files as backed up on Server_A are going to
be restored into differently named directories on Server_B?
Message posted via droptable.com
http://www.droptable.com/Uwe/Forum...server/200507/1Here's an example of moving from one location to another.
restore database bar
from disk = 'c:\Program Files\Microsoft SQL Server\MSSQL\Backup\foo.BAK'
with move 'fooData' to 'c:\Program Files\Microsoft SQL
Server\MSSQL\Data\bar.mdf',
move 'fooLog' to 'c:\Program Files\Microsoft SQL
Server\MSSQL\Data\bar_log.ldf',
UNLOAD ,
replace
"Robert Richards via droptable.com" wrote:

> If I am restoring a database from a backup file on disk on Server_A to a
> database on Server_B, in the restore syntax do I need to specify the "with
> move" clause if the data and log files as backed up on Server_A are going
to
> be restored into differently named directories on Server_B?
>
> --
> Message posted via droptable.com
> http://www.droptable.com/Uwe/Forum...server/200507/1
>|||Hi,
If you are restoring the database into different directories which is
differing to source directory, then you have to say
with MOVE clause in RESTORE DATABASE command.
Syntax:-
RESTORE DATABASE MyNwind FROM Disk='D:\Backup\MyNwind.BAK'
WITH MOVE 'MyNwind' TO 'c:\Program Files\Microsoft SQL
Server\MSSQL\Data\NewNwind.mdf',
MOVE 'MyNwindLog1' TO 'c:\Program Files\Microsoft SQL
Server\MSSQL\Data\NewNwind.ldf', STATS=10
Thanks
Hari
SQL Server MVP
"Robert Richards via droptable.com" <forum@.droptable.com> wrote in message
news:515E51CF9507A@.droptable.com...
> If I am restoring a database from a backup file on disk on Server_A to a
> database on Server_B, in the restore syntax do I need to specify the "with
> move" clause if the data and log files as backed up on Server_A are going
> to
> be restored into differently named directories on Server_B?
>
> --
> Message posted via droptable.com
> http://www.droptable.com/Uwe/Forum...server/200507/1|||Just curious, do the data files and such on the originating server remain
usable after the restore to the destination server? That is, I am creating a
backup of production for testing, and I of course want my production databas
e
to remain.
Hari Prasad wrote:[vbcol=seagreen]
>Hi,
>If you are restoring the database into different directories which is
>differing to source directory, then you have to say
>with MOVE clause in RESTORE DATABASE command.
>Syntax:-
>RESTORE DATABASE MyNwind FROM Disk='D:\Backup\MyNwind.BAK'
>WITH MOVE 'MyNwind' TO 'c:\Program Files\Microsoft SQL
>Server\MSSQL\Data\NewNwind.mdf',
> MOVE 'MyNwindLog1' TO 'c:\Program Files\Microsoft SQL
>Server\MSSQL\Data\NewNwind.ldf', STATS=10
>Thanks
>Hari
>SQL Server MVP
>
Message posted via droptable.com
http://www.droptable.com/Uwe/Forum...server/200507/1|||When you do a backup it essentially makes a pseudo copy. Nothing happens to
the original files at all.
Andrew J. Kelly SQL MVP
"Robert Richards via droptable.com" <forum@.droptable.com> wrote in message
news:515FA18FA3868@.droptable.com...
> Just curious, do the data files and such on the originating server remain
> usable after the restore to the destination server? That is, I am creating
> a
> backup of production for testing, and I of course want my production
> database
> to remain.
> Hari Prasad wrote:
>
> --
> Message posted via droptable.com
> http://www.droptable.com/Uwe/Forum...server/200507/1sql

No comments:

Post a Comment