Clearing the Client-Side Cache

A collection of information about Vault, including solutions to common problems.

Moderator: SourceGear

Post Reply
lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Clearing the Client-Side Cache

Post by lbauer » Tue Mar 31, 2009 3:24 pm

The Vault Client stores information locally about the repository tree and the state of files in the working folder. If this information gets out of sync with the repository, errors can occur. Deleting all or a portion of the client-side cache can re-sync the client-side information.

More information on the cache can be found here: http://support.sourcegear.com/viewtopic.php?t=6

Make sure any Vault and Visual Studio clients are closed before deleting the cache. If possible, we also suggest that you restart the Vault Server with an iisreset command to flush the Vault Server cache after the client-side cache has been deleted and before clients are re-opened.

*** To clear parts of the cache from Vault 8.0.1 Client and later.

Go to the Vault GUI Client's menu - Tools -> Options -> Local Files -> Cache Location. Click the button Reset Repository Cache. That will bring up a second window where you can choose which parts of the cache to clear out.
  • Change Set Information - Stores certain change set operations not committed to the repository (for example, but not limited to - branch, rename, move, delete)
  • Repository Information - Stores information about objects and versions found in the repository
  • Working Folder Information - Stores information about what local folders are set as working folders within the repository
  • Baseline Files from Client Cache Folder - Stores data from files retrieved from the Vault Server in order to do comparisions and determine diff data when committing files to the Vault Server
After this, your files might be in an Unknown or Missing status. As long as you aren't editing old files, you can perform a Get Latest with the option Do Not Overwrite/Merge Later. If you cleared out the working folder, then you will need to set the working folder again as well.


*** To clear just the cached tree on Vault 7.1.x Client and earlier, follow these steps:

Go to the Vault GUI Client's menu - Tools -> Options -> Local Files -> Cache Location. Click the button Reset Repository Cache. That clears out the files CacheMember_Repository and CacheMember_LastStructureGetTime.

After this, your files will be in an Unknown status. As long as you aren't editing old files, you can perform a Get Latest with the option Do Not Overwrite/Merge Later.

*** To clear or rename the cache for a specific repository, follow these steps:

If you have multiple repositories, you will need to find the GUID (long ID number for the repository) for the repository cache you want to clear. Run this query against your sgvault database in SQL server. This will return a list of all the GUIDs and the name of the repositories they belong to.

Code: Select all

Use sgvault
Go
Select * from dbo.tblrepositories
Once you know the GUID, locate the cache folder on your local machine.

Depending on your operating system, find the path

Code: Select all

C:\Users\username\AppData\Local\Sourcegear\Vault_1\Client\{repository-guid}\{vaultuser}
or
C:\Documents and Settings\<userprofile>\Local Settings\Application Data\SourceGear\Vault_1 \Client \{repository-guid}\{vaultuser}\.

You will see several files that start with CacheMember and a folder called _sgvault (this contains baseline files).

--To reset parts of the repository cache but keep your working folders:
  • 1. Delete all the Cache Members except for
    CacheMember_WorkingFolderAssignments and CacheMember_ChangeSetItems
    (this tracks adds, deletes, moves, shares, and branches that are pending).
If you suspect any of the baseline files previously downloaded through the Vault client have been corrupted (for example with a global search and replace within the file system), you will need to Delete or rename the _sgvault folders found there as well.

--To reset the repository cache completely (without keeping working folder settings):
  • 2. Rename or delete the folder

    C:\Users\username\AppData\Local\Sourcegear\Vault_1\Client\{repository-guid}\{vaultuser}
    or
    C:\Documents and Settings\<userprofile>\Local Settings\Application Data\SourceGear\Vault_1 \Client \{repository-guid}\{vaultuser}\.

    or on a Mac
    ~/Library/SourceGear/Vault(Pro)_1/com.sourcegear.vault.guiclient/...

    on your local computer. That will force Vault to recreate all cache information for that repository. You will need to reset working directories.


Reopen Vault and perform a Get Latest with the option “Do not overwrite\merge later” rebuild the cache and reset file status.

*** For a quick, complete clearing of the cache for all repositories (or to rename entire cache):
You can do a more thorough clearing of the cache with the following steps --but this will require resetting working folders on all repositories.

Close any open clients. Go to the path %USERPROFILE%\Local Settings\Application Data\SourceGear\Vault_1 and delete or rename the entire Vault_1 folder. Restart IIS to clear the Vault Server cache before you log in again.
You will need to reset working folders and perform a Get Latest with Do Not Overwrite/MergeLater to re-establish baselines, rebuild the cache files and reset file status.

Note: These steps also apply to Fortress and VaultPro clients, except that the path to the Fortress client side cache is Fortress_1, and the VaultPro cache is VaultPro_1
Linda Bauer
SourceGear
Technical Support Manager

Post Reply