Block Migration Tool
The Block Migration Tool simplifies transferring data from the MES Line Control database to the Block and Release Management (BMS) system and Industrial Application System Line Control database. It’s user-friendly, ensures safe migration, and preserves your original data until the process completes successfully. This guide covers setup, usage, and troubleshooting.
Back up the Blocks and BMSBlocks tables in Line Control and the Blocks table in Supermarket. If no backup, you will have no choice to rollback to MES. |
Preparation
Before starting, ensure the following:
-
Installation: Install the tool via the MES Installer.
-
Configuration: Set up database connections and BMS settings in the configuration file (e.g.,
C:/OPCON/bin/BlockMigrationTool/appsettings.json
). See configuration example below:{ "MigrationOption": { "LineControlDB": "Data Source=%%LINECONTROL_DATASOURCE%%;Initial Catalog=LineControlDB;Integrated Security=True", (1) "SupermarketDB": "Data Source=%%SUPERMARKET_DATASOURCE%%;User Id=%%SUPERMARKET_USERNAME%%;Password=%%SUPERMARKET_PASSWORD%%", (2) "Csv": "logs/" (3) }, "BlockMigrationConfig": { "SourcePlant": "%%SOURCE_PLANT%%", (4) "SourceApplicationToken": "%%SOURCE_APPLICATION_TOKEN%%", (5) "BlockManagementUrl": "%%BLOCK_MANAGEMENT_URL%%", (6) "AuthenticationUrl": "%%SOURCE_URL%%", (7) "TenantId": "%%TENANT_ID%%", (8) "ClientId": "%%CLIENT_ID%%", (9) "ClientSecret": "%%CLIENT_SECRET%%", (10) "Scope": "%%SCOPE%%", (11) "HttpTimeout": 30 (12) } }
1 This is the connection string to the Line Control DB 2 This is the connection string to the Supermarket DB 3 Path for the log file when migration process has exception 4 Plant Identifier to identify where Blocks come out (e.g. SzH/RtP2/ChP) 5 Unique identifier for the application which was the origin creator 6 URL of Block Management 7 URL of Open ID-capable security system 8 Defines the default tenant to use when fetching ACLs 9 Client credentials to access authorisation information through Industrial Application System MACMA interface 10 Client credentials' secret. 11 Access scope, use aud:{ClientId} openid 12 Http request time out(second) -
Backup: Back up the Blocks and BMSBlocks tables in Line Control and the Blocks table in Supermarket.
Using the Tool
Run the tool via command line using Bosch.Nexeed.LineControl.BlockMigration.exe
. Below are the key options and steps.
Command Options
Option | Values | Description |
---|---|---|
|
|
|
|
|
Specifies types of MES blocks to migrate. Default: |
|
|
Includes Supermarket data if |
Example Command
-
Open Command Prompt (Windows: Win + R, type
cmd
, press Enter). -
Run:
Bosch.Nexeed.LineControl.BlockMigration.exe --strategy=One2Many --blockType=Part --supermarket=true
This merges all part blocks into a single BMS block (or grouped by severity if varied) and Supermarket data also migrated.
Results
- Success
-
-
Migration completed
displays on command-line. -
Source blocks are deleted from the Blocks/BMSBlocks table.
-
No issues logged in
C:/OPCON/bin/BlockMigrationTool/logs/failed_log.csv
.
-
- Failure
-
-
There are errors logged in
C:/OPCON/bin/BlockMigrationTool/logs/failed_log.csv
. -
Rerun the tool. Original blocks remain unchanged unless migration completes successfully.
-
Important Notes
Backups
Always create a backup before starting. If needed, restore the database to revert to MES Line Control.
Partial Failures
Blocks migrate in batches. If a batch fails after others succeed, failed blocks remain in the source table. Re-run the tool to retry.
Duplicates
-
Identical part, location, or process blocks across source databases may create duplicates in BMS, which then syncs them to all LineControl databases.
-
E.g. In rare cases, when multiple LineControl instances have same block item (e.g. part ID), running the Migration Tool on these databases synchronizes the blocks to BMS, distributing them to all LineControl databases.
Do not close the command-line window
Please keep the command-line window on until 'Migration completed' displayed on screen. If we close the command-line, some blocks may already be synchronized to BMS but not deleted from Line Control database, next time when we re-run the tool, there will be duplicated blocks created in BMS and the blocks will all be synchronized to different Line Control databases.