Thursday, 28 July 2011

How to force a SharePoint 2010 Business Connectivity Services (BCS) Client Cache to rebuild

WARNING! This tip involves potential loss of data.
The Business Connectivity Services (BCS) Client Cache is a combination of PST files and a SQL Server Compact Edition database - that allows for you to operate with Business data while in disconnected or limited-connection scenarios.

It contains all the subscription information and data for any items that you have made available offline via Business Connectivity Services. However, there is no official way of flushing this cache - your BusinessDataCache.sdf file will just keep growing and growing ad infinitum. You can query this data by connecting to it via Visual Studio 2010 via the Server Explorer/Data Connections task pane.(For reference, the Schema of the BCS Client Business Data Cache is shown below)


At the risk of data loss (if you have any unsynched items), there is a way of recreating your cache without deleting your whole Windows Logon profile. This is as follows:

  1. Uninstall any Office Add-ins you have e.g. Outlook Addins that use the BCS cache or create subscriptions in the BCS cache.
  2. Kill the BCSSync.exe process in memory using Windows task manager.
  3. Go to the following folder on the machine:
    %userprofile%\AppData\Local\Microsoft\BCS
  4. Rename BusinessDataCache.sdf to zzBusinessDataCache.sdf
  5. Run "%ProgramFiles%\Microsoft Office\Office14\BCSSync.exe" /Restart /Activation /RestartApps to restart the BCS Synchronization service.
  6. Your BusinessDataCache.sdf  file will be regenerated.
DDK

No comments: