Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a database backup file (MyDatabase.bak). When restoring the database through SSMS it gives me "Not enough space on disk" message. I looked for an option to exclude .LOG file from restore but could not find one.

I even tried to remove the "MOVE .LOG" from restore query but got an error message "could not find .LOG file use WITH MOVE option".

Is there an option to exclude the log file while restoring the database?


share|improve this question

migrated from Jan 21 '12 at 15:01

This question came from our site for professional and enthusiast programmers.

up vote 3 down vote accepted

No: the log is an essential part of the database and is used during RESTORE process (redo/undo phases) to ensure consistency.

Use WITH MOVE to restore to a compressed folder to gain "more" disk space temporarily. Or an external USB drive etc


By compressed, I mean NTFS compression (for XP but still applies).

WITH MOVE is part of restore exposed as "Restore the database files as" in SSMS

Edit 2:

SQL Server can not use network drives unless you enable trace flag 1807. Now, use at your own risk to get running again only

share|improve this answer
+1 - Also a missing log can lead to a DB being marked suspect in SQL Server. – JNK Aug 10 '10 at 19:12
@gbn: I tried to search for "WITH MOVE restore to compressed folder" but could not find anything useful. Can you pls. suggest how do i go about restoring to a compressed folder? – stackoverflowuser Aug 10 '10 at 19:37
Additionally I tried to give a network path (Mapped network drive) but it gave up error message "Directory lookup for file R:\Log\MyDatabase.LDF" failed. System cannot find the path specified". I have ensured the path is accessible. Are network path not valid while restoring ?? – stackoverflowuser Aug 10 '10 at 19:43
Messing with compression is a recipe for disaster. Go back to the source of the DB, run a shrink to clean out the log file, then move it again. – JNK Aug 10 '10 at 19:56
@JNK: I already looked into that option. But it seems the db is long gone. Only .bak file is available. – stackoverflowuser Aug 10 '10 at 19:59

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.