title: SQL Server 2012: trouble restoring database backup
body: <p>I tried running the following query to restore a database:</p>
  
  <pre><code>restore database myDatabase
  from disk=
  'C:\Program Files\Microsoft SQL Server\MSSQL11.SQLSERVER2012\MSSQL\Backup\myDatabase_backup_2012_06_20.bak' 
  with replace, 
  
  move 'myDatabase' to 
  'C:\Program Files\Microsoft SQL Server\MSSQL11.SQLSERVER2012\MSSQL\DATA\myDatabase',
  
  move 'Analytics_log' to 
  'C:\Program Files\Microsoft SQL Server\MSSQL11.SQLSERVER2012\DATA\myDatabase_log.ldf'
  </code></pre>
  
  <p>And am getting the following error:</p>
  
  <blockquote>
    <p>Msg 5133, Level 16, State 1, Line 1 Directory lookup for the file<br>
    "C:\Program Files\Microsoft SQL
    Server\MSSQL11.SQLSERVER2012\DATA\myDatabase_log.ldf" failed with the
    operating system error 2(The system cannot find the file specified.).  </p>
    
    <p>Msg 3156, Level 16, State 3, Line 1 File 'myDatabase_log' cannot be
    restored to 'C:\Program Files\Microsoft SQL
    Server\MSSQL11.SQLSERVER2012\DATA\myDatabase_log.ldf'.<br>
    Use WITH MOVE
    to identify a valid location for the file.</p>
  </blockquote>
  
  <p>For the first error, it seems like SQL Server cannot find the .ldf file. However, it is in that location and was listed in the results when I ran <code>restore filelistonly</code> on the .bak file.</p>