No description
Find a file
2026-07-10 15:19:46 +00:00
.forgejo/workflows added forgejo pipeline 2026-07-10 17:14:55 +02:00
DBSwitch added scroll to database list 2026-07-10 17:14:26 +02:00
.gitattributes Add .gitattributes and .gitignore. 2025-04-30 15:09:39 +02:00
.gitignore Add .gitattributes and .gitignore. 2025-04-30 15:09:39 +02:00
.gitlab-ci.yml removed implicit usings & added release pipeline 2026-03-02 15:57:42 +01:00
DBSwitch.sln.DotSettings Introduced Database Class & Auto-Compression 2025-08-22 17:58:10 +02:00
DBSwitch.slnx removed implicit usings & added release pipeline 2026-03-02 15:57:42 +01:00
README.md Added README 2026-02-12 15:46:25 +01:00

DB-Switch

A console-based database switching utility for managing and mounting multiple Komax HMI databases using symbolic junctions.

Overview

DB-Switch simplifies the process of switching between different database versions by:

  • Managing multiple database instances in a compressed format
  • Creating and removing Windows junction points to mount databases
  • Providing an interactive fuzzy-search interface
  • Cloning and creating new database instances

First-Time Configuration

On first startup, DB-Switch will prompt you to configure the following settings:

Required Settings

  1. BasePath: The base path where the Komax HMI installation is located

    • Example: C:\Program Files\Komax
    • The database will be mounted at: {BasePath}\Data\KomaxHMI\Database
  2. DatabasesPath: The directory where all database versions are stored

    • Example: C:\Databases\AllDatabases
    • This folder should contain subdirectories for each database version

These settings are saved to appsettings.json and can be manually edited later.

Example appsettings.json

{ 
"UserSettings": { 
  "BasePath": "C:\Program Files\Komax", 
  "DatabasesPath": "C:\Databases\AllDatabases" 
  } 
}

Features & Usage

Basic Navigation

  • Type to filter: Start typing to fuzzy-match database names or enter an index number
  • Enter: Select the database when only one match remains, or select by exact index
  • Tab: Apply current filter and narrow down the database list
  • Escape: Reset filter and show all databases

Function Keys

Key Function Description
F1 Edit Mode Toggle advanced edit mode for additional operations
F2 Create DB Create a new empty database

Edit Mode Operations (F1)

When edit mode is activated, you can choose from the following actions for any database:

  1. Select: Mount the selected database (same as normal selection)
  2. Clone: Create a copy of the database with a new name
    • Prompts for a new database name
    • Creates a complete copy in the DatabasesPath
    • If cloning the currently mounted database, the HMI application will be closed

Create Empty Database (F2)

Creates a new empty database directory:

  • Prompts for a database name
  • Creates the directory structure in DatabasesPath
  • Adds it to the available databases list

How It Works

Database Mounting Process

  1. Unmount Current: Kills any running HMI processes and removes the current junction
  2. Compress: Packs the current database into a .zip file for storage
  3. Decompress: Unpacks the selected database (if compressed)
  4. Mount: Creates a Windows junction point to the selected database directory
  5. Ready: Database is now active and ready for use

Database Storage

  • Databases are stored compressed (as .zip files) when not in use
  • Only the mounted database is decompressed
  • This saves disk space when managing multiple database versions

Display Information

The main interface shows:

  • Currently Mounted Database: Displayed in red at the top
  • Database List: All available databases with their index numbers
  • MOUNTED indicator: Shows which database (if any) is currently active
  • Highlighted Matches: Fuzzy-matched characters are highlighted in yellow

Requirements

  • Windows OS (uses mklink command for junctions)
  • Administrator privileges (required for creating symbolic links)
  • .NET 8 Runtime

Notes

  • The application automatically terminates the Komax.Program.KomaxHMI process when switching databases
  • Database operations show progress indicators for compression/decompression
  • Press any key to exit after a database is successfully mounted

Troubleshooting

Database not mounting: Ensure the application is run with administrator privileges

HMI process not found: The application will continue without error if the HMI process isn't running

Directory already exists: When creating or cloning, ensure the new database name is unique