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 SQLMonster.com
http://www.sqlmonster.com/Uwe/Forums.aspx/sql-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 SQLMonster.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 SQLMonster.com
> http://www.sqlmonster.com/Uwe/Forums.aspx/sql-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 SQLMonster.com" <forum@.SQLMonster.com> wrote in message
news:515E51CF9507A@.SQLMonster.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 SQLMonster.com
> http://www.sqlmonster.com/Uwe/Forums.aspx/sql-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 database
to remain.
Hari Prasad wrote:
>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
>> 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 SQLMonster.com
http://www.sqlmonster.com/Uwe/Forums.aspx/sql-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 SQLMonster.com" <forum@.SQLMonster.com> wrote in message
news:515FA18FA3868@.SQLMonster.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:
>>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
>> 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 SQLMonster.com
> http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server/200507/1
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment