This script allows you to decompress and rename a sequence of Storico files for massive re-import of old CDR (see this article for more details: https://kbp.imagicle.com/ucxca/how-to-clean-up-sql-server-call-archive-with-multi)
You just need to specify the date range you need to reimport and it will decompress only the relevant Storico files.
After running this script remember to edit the first and last uncompressed files to include only the date-time range that you actually need to re-import (as per the KB article).

When running the script you must specify the following parameters:
-StartDate (YYYYMMDD format)
-EndDate (YYYYMMDD format)
-SourceFolder (where the ZIP files are located, default is "C:\Program Files (x86)\StonevoiceAS\Apps\BillyBlues\Engine\BluesRecPro")
-DestinationFolder (by default it saves the uncompressed files into "C:\Program Files (x86)\StonevoiceAS\Apps\BillyBlues\Engine\BluesRecPro\ExtractionsForReimport")

For instance, if you need to reimport from March 30,2026 (included) to April,24th 2026 (included), you can run from a powershell window:
.\UncompressStoricoFilesForReimport.ps1 -StartDate 20260330 -EndDate 20260424 -DestinationFolder "C:\Imagicle Repository\ReprocessStoricoFiles\StoricoFiles"

NOTES:
- an empty file SITEbluesrecSITE_D.txt is alway created to trigger the sequential processing mechanism of the miner.
- if the end date correspond to a StoricoFile rollover, the script automatically includes also the next StoricoSITE zip file, to include all the relevant CDR of the last date.