Recovering your model when you can’t save the BIM file

It is possible for the tabular designer to get into an error state. If you try to save the model, you can get this error message: “Unable to save the file Model.bim. Reason: The file cannot be saved because it is marked as readonly.”


Most of the time, you see this error if the tabular designer has lost the connection to the workspace database server at some point during the editing session. This can happen if the workspace database server is restarted or if the network connectivity is lost. We did not have time in Denali to implement any sort of retry logic here, so once the connection is lost the editing session is over.

I think the only other way to get to this state is after a bug has happened. If you see this error in other conditions, file a bug on Connect.

Don’t be too scared of this error message. There is a way to recover the work you did since the last save of the model, even though you can’t just press Ctrl+S to save the file. The workspace database holds the latest copy of all edits you have made since last save. All you have to do is create a new BIM file from the workspace database, and you’re good to go.

The safest way to recover your work is as follows:

  1. Keep your read only model open in VS.
  2. Open SSMS.
  3. Right click the workspace database you want to recover, script CREATE to a new window.
  4. Change the database name and ID (they must match), execute the script. You have now cloned the workspace database.
  5. Go back to BIDS. File->New Project. Select Import from Server (Tabular) as the project type.
  6. Select the database you created in step 4. OK

A new BIM file is created with all the changes you have made since you last changed the old BIM file. Simply discard the old BIM file/project and continue using this new project. You have now recovered your work.

To be perfectly honest, I have known about this file saving issue for well over a year and never come up with this recovery strategy until a customer call this week. I managed to recover the user’s changes on the fly and look like a hero. My next thought was crap, how come I never thought of this before! I used to tell people that their changes were irretrievably lost when they saw this error message. My sincerest apologies to those people that dropped their data based on my previous advice. Hopefully you will all read this post and save your data next time.

Comments (8)

  1. John says:

    Thanks,  That helps a lot.  I've lost some work and now know how to recover.

  2. Voorshwa says:

    I appreciate your work here, and the process of getting all this back.  However, if you just go the folder with the Model.bim file, open it's properties and uncheck Read-Only, the problem is solved.  Just did it and everything saved.



  3. Mindy says:

    Thanks for this!

  4. Nope says:

    file model.bim IS NOT marked as readonly – so it doesn't work. Only works restore of workspace database.

  5. Patrick H. says:

    I did not want to recreate a workspace so I tried Voorshwa's recommendation and also saw that my bim file was not set to read-only. However, I checked the read-only box, applied and saved, then went back in and unchecked the read-only box, applied and saved, and everything worked. I'm not sure if this will work for everyone, however it worked for me. Thanks for this post.

  6. Indro MSFT says:

    I changed the file attributes, unchecked Read-Only and it solved it.

  7. Rockstar says:

    Also, changing the Deployment database and Workspace database server in Tools->Options->Analysis services tabular designers, helped me solve this problem

  8. Doug says:

    Unfortunately, your instructions are incomplete for those of us who don't work with this 24/7.


    4.  Change the database name and ID (they must match), execute the script. You have now cloned the workspace database.

    I know how to change the DB name in the SSAS GUI, but I could not find an ID anywhere.  This did not work for me.  Fortunately, I have a recent backup.

Skip to main content