Show / Hide Table of Contents

Index table migration

This article covers process of migrating index table from old format (used in versions 3 and older) to new format (used in versions 5 and newer).

Migration can be done in multiple ways:

  1. Manually using "Portos eKasa servis" application
  2. Programatically using MigrationManager class located in NineDigit.eKasa.StorageManagement NuGet package.

Manual approach

  1. Open "Portos eKasa servis" application.
  2. Make sure the protected memory (CHDU) is connected to the computer.
  3. Click on "MIGROVAŤ TABUĽKU INDEXOV" button in "Tabuľka indexov" section on home screen ("Prehľad")
  4. Choose whether index table will be located automatically ("Automaticky vyhľadať tabuľku indexov") or whether you want to specify index table file path explicitly ("Vybrať tabuľku indexov").
  5. Click confirm button ("POTVRDIŤ").

Programmatic approach

Locate index table automatically based on configuration file

// default path to the confiuration file
string configurationFilePath = Path.Combine(
  Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData),
  "NineDigit",
  "Portos.eKasa",
  "settings.json");

// please see article dedicated to logging to provide real logger.
ILoggerFactory loggerFactory = NullLoggerFactory.Instance;

// create migration manager instance
MigrationManager migrationManager = new MigrationManager(loggerFactory);

// migration manager look up index table file path based on provided configuration
await migrationManager.MigrateAsync(configurationFilePath, CancellationToken.None);

Specify file to migrate explicitly

// please see article dedicated to logging to provide real logger.
ILoggerFactory loggerFactory = NullLoggerFactory.Instance;

// create migration manager instance
MigrationManager migrationManager = new MigrationManager(loggerFactory);

MigrationContext migrationContext = new MigrationContext("path-to-the-index-table.dat")
{
    // The `StorageModel` and `StorageSerialNumber` properties are optional.
    // They will be readed from connected device, if not specified.
    StorageModel = StorageModel.ChduSk, // optional
    StorageSerialNumber = "3651181395" // optional
};
await migrationManager.MigrateAsync(migrationContext, CancellationToken.None);
In This Article
Na začiatok stránky Nine Digit, s.r.o. ©