BlobExport

Utils.BlobExport.exe is a console application used to export recordings, attachments, and emails (iCC.Message.Eml, iCC.Attachment.BinaryContent, SRec.VoiceRecord.RecordData) that are stored in the FrontStage V3 local database to a local file system or Azure cloud storage. Exporting .mp3 from the file system is also available.

The utility itself does not delete any binary data from the database or file storage. The utility requires the installation of .NET 8 for Windows - it is optimal to install the relevant .NET Desktop Runtime.

Command line

The export type is specified from the command line using the first parameter. Possible values are:

  • Message - export Message.Eml, the exported items will have the DeviceRank column changed

  • Attachment - export Attachment.BinaryContent, exported items will have the DeviceRank column changed

  • VoiceRecord - export VoiceRecord.RecordData or files referenced in the VoiceRecord.FileName column, exported items will have the CallState column changed (the column name can be changed in the configuration)

  • Both - export as Message and Attachment

  • All - export all

Configuration

The utility requires settings in the appsetting.json file:

{

"Logging": {
"LogLevel": {
    "Default": "Information",
    "System": "Warning",
    "Microsoft": "Warning"
},
"Console": {
    "FormatterName": "simple"
}
},
"BatchSize": 100,
"ConnectionStrings": {
    "iCC_ConnectionString": "Server=.;Database=iCC;Trusted_Connection=True;TrustServerCertificate=True;",
    "SRec_ConnectionString": "Server=.;Database=SRec;Trusted_Connection=True;TrustServerCertificate=True;"
},
"SRecSourceFolderPath": "C:/Temp/VoiceRecordSoundFiles",
"VoiceRecordMarkingColumn": "CallState",
"MessageStorage": {
    "DeviceType": "StorageFileHierarchy",
    "DeviceRank": 80,
    "RootDirectoryPath": "C:/Temp/BlobExport"
},
"AttachmentStorage": {
    "DeviceType": "StorageFileHierarchy",
    "DeviceRank": 80,
    "RootDirectoryPath": "C:/Temp/BlobExport"
},
"VoiceRecordStorage": {
    "DeviceType": "StorageAzureBlob",
    "DeviceRank": 90,
    "ConnectionString":
    "DefaultEndpointsProtocol=https;AccountName=xxxxxxxxxxxxx;AccountKey=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx;EndpointSuffix=core.windows.net",
    "ContainerName": "blobexport2"
}
}

General settings

  • Logging - standard section

  • BatchSize - batch size (number of records that are processed at once)

Source data

  • iCC_ConnectionString - access to the FrontStage database. For more info see Connectionstring. (V3.25 - the schema must already contain the DeviceRank column in the Message and Attachment database tables), relevant for message and attachment exports

  • SRec_ConnectionString - access to SRec database (V3.x), relevant for exporting recordings

  • VoiceRecordMarkingColumn - the name of the column from the VoiceRecord table that is used for marking already exported records. Relevant for exporting recordings

  • SRecSourceFolderPath - the root folder for the recordings stored in the file system and referenced by the relative path in the FileName column of the VoiceRecord database table. Relevant for exporting recordings

Target data

There are three sections for specification: MessageStorage, AttachmentStorage and VoiceRecordStorage. These sections for the corresponding export type have a structure analogous to the storage definitions in the Device table in V6/V7, and the structure is always the same.

  • DeviceType - storage type, possible values are only StorageFileHierarchy and StorageAzureBlob

  • DeviceRank - repository index (positive integer 1..32767) used to mark exported records. To keep track, it is advisable to use the same number as used in V6/V7 in the definition of the storage device

StorageFileHierarchy

This repository stores data in subfolders of the root folder, with the file stored two levels down so that the first two characters of the file ID are used for the first level and the second two characters for the second level. Files always have a .bin extension. The root folder is configured with the RootDirectoryPath parameter.

StorageAzureBlob

This stores data in the “Azure Storage Account”, more precisely in the “Blob Storage” container. Two parameters configure access to the storage:

  • ConnectionString - “SAS” (Shared Access Signature) read/write/write access string

  • ContainerName - container name

Storage:

../../_images/blob-storage.en.png

Container:

../../_images/blob-container.en.png

Creating a SAS access token:

../../_images/blob-sas.en.png

Running

An example of exporting to StorageFileHierarchy and checking the result.

The program gradually lists the progress. After the export has been performed, the records are always marked in the database. The program can be interrupted and restarted at any time; it will continue where it left off.

../../_images/blob-app-runtime.en.png

Methodology

Possible uses are either backing up binary content or preparing for V3 to V6/V7 migration. During migration, it is assumed that all binary data is exported sequentially. After their verification and possible backup of the V3 database, it is assumed that the binary data for records with the DeviceRank value set will be deleted. For voice recordings in file storage, there is no need to delete anything in the database. If the VoiceRecord.RecordData column was used for storage, its contents are deleted according to the marking in CallState. After that, shrink (database operation, making it less fragmented) and the migration scripts are applied. It is then transferred to the target database machine.