SQLTeam.com | Weblogs | Forums

Why are LogicalName and PhysicalName different?

I'm wanting to do a restore to different SQL server, and using different DB name.
I'm trying to restore from SQL 2008 to SQL 2014.
I ran:
** FROM DISK = '\sql1\Backup\P21\MYBACKUPFILE.bak'**

and it produced:
seed16_data D:\DBNAME.mdf
seed16_log D:\DBNAME_Log.ldf

a restore of course, is failing..


That's not why the restore is failing. Show us the restore error. I'm guessing you just need WITH MOVE added to your command.

Why are they different? Maybe they were setup that way, maybe a restore occurred that changed them, maybe the database was renamed at some point, maybe ALTER DATABASE was run to change them. Could be lots of different reasons.

RESTORE DATABASE P21TEST FROM DISK = '\\sql1\Backup\P21\P21_backup_2016_02_03_222153_3709194.bak' WITH MOVE 'P21' TO 'G:\SQL\DATA\P21TEST.mdf', MOVE 'P21_Log' TO 'G:\SQL\DATA\P21TEST_Log.ldf', NORECOVERY

You need to specify seed16_data and seed16_log in your WITH MOVE, not P21.

WITH MOVE 'seed16_data' TO 'G:\SQL\DATA\P21TEST.mdf',
MOVE 'seed16_log' TO 'G:\SQL\DATA\P21TEST_Log.ldf',

boy, I thought it would be some convoluted work-around/kludge...
not something...straightforward...
:slightly_smiling:thanks, will try asap

1 Like

it's crunching on it: once I included 'WITH REPLACE'


1 Like