SQLTeam.com | Weblogs | Forums

Why are LogicalName and PhysicalName different?


#1

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:
** RESTORE FILELISTONLY**
** FROM DISK = '\sql1\Backup\P21\MYBACKUPFILE.bak'**

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

a restore of course, is failing..

Thoughts?
Thanks,
Rich


#2

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.


#3

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.


#4

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


#5

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


#6

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


#7

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


#8

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

:slight_smile: