How to change the location where license information is stored
Overview
This guide explains how to migrate your end-users' license keys from one storage location to another when you decide to change where your application stores QLM license keys. The provided MyLicenseValidator class demonstrates a best-practice implementation for seamless key migration.
When to Use This
You should implement key migration when: • Changing from Windows Registry to file-based storage (or vice versa) • Moving from per-user storage to machine-level storage (or vice versa) • Switching between different EStoreKeysTo locations in your application
How It Works
Key Features:
Non-destructive: Original keys remain in the old location
One-time operation: Uses a cookie flag to prevent repeated migrations
Transparent: Runs automatically on application startup
Fallback logic: Checks new location first, then old location Migration Flow
Check Migration Status: Reads a cookie named "keyLocationMigrated" to determine if migration has already occurred.
Attempt Current Location: Tries to read keys from your newly configured storage location.
Fallback to Old Location: If no keys found, temporarily switches to the old storage configuration and attempts to read keys there.
Copy Keys Forward: If keys are found in the old location, stores them in the new location using StoreKeys().
Set Migration Flag: Writes a timestamp cookie to prevent future migration attempts.
Implementation Steps
Customize Migration Parameters Modify these variables in MigrateKeys() to match your specific migration scenario:
Configure Your New Storage Location Set your desired storage location in your QLM settings file or during LicenseValidator initialization:
Integrate into Your License Validator
Instead of using the default LicenseValidator class, update your code to use MyLicenseValidator which inherits from LicenseValidator and adds the migration code.
Last updated