We have this Data Backup property on the .bim file that by default is turned off. You may wonder why this property exists. Let us explore what it is this property does, and why it (and backups in general) are useful in the tabular designer.
The Data Backup property specifies whether or not an ABF file is created whenever the .bim file is saved. When you save, we create an ABF backup of the workspace database, so all the data you have processed into the workspace database is preserved. This file is saved in the same directory as the tabular project.
There are three scenarios in which taking a backup from directly from the designer is useful. There’s a fourth scenario in which the ability to restore from a backup taken from outside the designer is useful. Let’s walk through them.
Alice, a developer, builds a very nice model and wants to share it with Bob, another developer. Bob wants to see the data that Alice saw when she was modeling, but Bob doesn’t want to sit around all day processing his workspace database when he receives the .bim file and the .smproj file. What to do?
Here is how Alice and Bob can share the data:
As I mentioned in my tabular model architecture post, every change you make in the tabular designer sends an alter to the workspace database. If you save your changes when you close the designer, the workspace database and the .bim file stay in sync on close. The next time we open the .bim file, we attach the workspace database, everything is as you left it, and you are good to go.
However, when you close without saving your changes, the metadata in the .bim file may become out of sync with the workspace database. We always assume that when you open the .bim file, you want to see the metadata from the .bim file, not the metadata from the changes you abandoned previously.
If you don’t have a backup of your model, you wind up with some potentially funky behaviours when you close without save. For example, say you delete a table, close without saving, and re-open your model. The metadata for the table re-appears, as expected. We apply the changes from the .bim file to the workspace database. However, the data from the table is gone! This is because you deleted the data from the workspace database when you deleted the table originally.
To avoid getting yourself into this partially processed situation, set the Data Backup property to “Back up to disk”. That way, you always have a set of data that matches the metadata of the .bim file. We can then restore this ABF on load as necessary to ensure you are always modeling against a full set of data.
By default, we detach workspace databases on close. If you work with lots of tabular projects, your OLAP\Data directory for the workspace database server gets clogged with all the temporary workspace databases. One way to avoid this problem is to change the Workspace Retention property of the .bim file to “Delete workspace”. When you close the .bim file, the workspace database gets deleted, and your OLAP\Data directory remains fresh and clean.
The problem with that approach, of course, is that when you reopen the .bim file, the data is gone. This problem can be avoided by setting Data Backup property to “Back up to disk” when the Workspace Retention property is set to “Delete workspace”. On next open of the .bim file, we restore the .abf file on open, and your data re-appears.
Alice gets a frantic phone call. Her customer, Eve, needs a small change to her model (say adding a measure) immediately! Alice wants to see the impact of her changes as she works, so she wants to model against metadata and data. Unfortunately, Alice doesn’t have the original sources for Eve’s model, so she doesn’t have any data hanging around locally. Online mode is not supported for tabular models. What to do?
Alice knows that she can use Import from Server (Tabular) to create a model that matches the metadata of Eve’s deployed model. However, Import from Server doesn’t bring the data. There is a hack that Alice can do so that she can see the data locally without waiting all day for the data to process (assuming Alice even had permission to Eve’s data sources, she probably doesn’t). Here’s how:
Here are some important things to keep in mind if you want to take backups from the designer:
A solution to this problem is to use a higher privileged user (such as yourself) as the service account for the workspace database service instance. This is not secure. It violates the principle of giving least possible privilege to service account users. That said, it is a very practical solution for many people.
The text for those last two bullet points may look familiar to some people. I copied and pasted them from the cryptic errors when importing from PowerPivot post and then subbed “PowerPivot workbook” for “Tabular project”. The fundamentals of the experience are the same for both, because both PowerPivot workbooks and ABF backups begin from the same action (restoring from image). Now you can really start seeing the impact of the out-of-proc server architecture.
PS – I just introduced you to the extra files I alluded to in the tabular project structure post, albeit in a roundabout way. Those two files are the ABF file and the hidden user settings file. You will hear more about the hidden user settings file later.