Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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'm trying to deploy an MDF file to my live server, but this also means going from SQL Express 2005 to 2008.

I'm getting the following error in my web page.

Database 'xxx.MDF' cannot be upgraded because it is read-only or has read-only files. Make the database or files writeable, and rerun recovery.

I've tried adding write permission to the IUSR account for the MDF and LDF file, but this doesn't work.

I've read this from MS support, but I don't really understand what I need to do in the context of an MDF file.

Has anyone else come across this and have a solution?


share|improve this question
up vote 2 down vote accepted

Try attaching the database with SQL Server Management Studio and see if the database upgrade still fails.

share|improve this answer
This worked, but it did lead to another permissions based error when I tried to run the site again. I rechecked permissions and it turned out the app_data folder settings had not been inheritted by both the DB files. Both files need modify permissions given to the IIS_IUSRS group. – Richard Aug 29 '09 at 8:47

If the database is attachable (you dont say if it is or not) then you need to enable writeability in an obsure area in the "properties" of the database. In SQL 2000 this use to be a checkbox setting but in SQL2005 SQL Management Studio Express it is a hard to find "true/false" setting in the db properties.

Also, you obviously should have a .LDF to go along with that right?

share|improve this answer

If you dont have the LDF you can try the following to attach your DB and see if the upgrade completes:

sp_attach_single_file_db @dbname= 'ENTER_DB_NAME', @physname= 'SOMEDRIVE:\SOME\LOCATION\TO\THE\DATABASEFILE.mdf'

Referenced From:

share|improve this answer
I have the LDF file. Sorry for not making that clear. – Richard Aug 29 '09 at 8:19

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.