Server Vault

Jump to: navigation, search

The server vault, the centralized repository for all ALFA character files, is hosted in Microsoft Azure. Formerly, it was connected over SSHFS, but this system has been deprecated as it had reliability issues and forced the existence of two separate OS's (Windows and Linux) that had to be independently patched, managed, and maintained for each game server instance.

Game server setup

See Basic Host Requirements: Configuration for details on how to set up DatabaseConnector.ini to manage the SSH tunnel used to connect to MySQL.


The VaultTransferTool, built out of the ACR repository (VaultManagement\VaultTransferTool), provides a basic set of functionality for managing the server vault, including uploading files to the vault (but only if the vault didn't have a more up to date version of the files), downloading the entire vault to a directory (but only for files that were older than the vault versions), as well as selectively deleting files from the vault.

One use of the VaultTransferTool would be to locally archive copies of the entire vault for selective restoration in case a character rollback had to be performed for technical or management reasons. Another use might be for selective BIC edits.

You can also use a tool like AzCopy to copy files to and from Azure, or any Azure Storage Explorer tool to browse the vault interactively. These require the use of an account name and access key, which can be obtained from the connection string (see the VaultTransferTool section below for details). While the VaultTransferTool is slower for bulk transfers than AzCopy due to operating synchronously, the use of the VaultTransferTool is recommended for most operations if possible because it handles case conversion properly (all files on the Azure vault must be lowercased) and automatically avoids overwriting newer files.

When deleting character files from the vault, remember to use the ALFA website's Clear Vault Cache tool to clear out any cached copies of the character file to delete in addition to removing the file from the Azure vault, so that the character file is not brought back the next time a player logs on to a server that previously hosted the character.


Build the ACR repository and then build the ACR_ManagedScripts solution in alfa2_acr.hak\ACR_ManagedScripts (or else simply build VaultManagement\VaultTransferTool\VaultTransferTool.csproj directly from MSBUILD).

All usage of the VaultTransferTool needs a connection string. Get this from the config table in the database (VaultConnectionString), and pass it on the command line with -connectionstring VaultConnectionString, in addition to the operation to perform. See ACR Configuration Settings for my details on the database config table.

Help text for the vault tool:

ALFA Azure Vault Management Tool v1.0.5334.26752


VaultTransferTool [-connectionstring <connection string>] [-download <path> | -upload <path> | -delete <path>] [-includeall]

The -connectionstring argument designates the Azure connection string to use to communicate with the vault.

One of -download <path>, -upload <path>, or -delete <path> must be specified. The -download and -upload options enable downloading files from the vault, or uploading files to the vault. The given path should be laid out like a normal server vault directory, with a subdirectory for each account name and character (*.bic) files in each subdirectory. Files are never deleted from the remote vault, only updated with -download or -upload. A file is only transferred if the source of the transfer is newer than the destination file (unmodified files aren't copied again).

To delete a file, use -delete <path> where <path> is in the form of account\character.bic. The file is permanently deleted from the Azure vault, but the cache should still be purged from each server using the purge cache tool to ensure that it is not regenerated the next time a player logs on to a server that had previously cached the character file to delete. The file to be deleted doesn't need to exist on the local machine, and is not deleted from the local machine if it did exist.

Normally, only character files (*.bic) are transferred. Use the -includeall argument to transfer all files, regardless of file extension.

Technical details

The ServerVaultConnector object in the ACR_ServerCommunicator manages the Azure vault storage, in conjunction with the server vault NWNX4 plugin. ALFA.Shared contains a wrapper (FileStore, AzureFileStore) around the Azure .NET storage library that manages the low level connectivity to the backing store for the vault.

The VaultTransferTool uses the ALFA.Shared FileStore/AzureFileStore mechanism to manage the vault.

Obsolete SSHFS vault documentation

See Connecting to the Server Vault for the obsolete documentation on the old SSHFS based vault mechanism. This isn't in use on any servers anymore.