Skip to main content

Installation and Usage

Here's how to go from scratch to your first run through TBT's interactive menu screen. Everything (gateway address, access data, database connection) gets filled in directly on screen, so there's no need to set up environment variables first. Work through the steps in order, since each one builds on the last.

Work through Prerequisites first if you haven't already.

note

Running TBT from a script instead of the screen? See Running Without the Screen (Automation) below.


1. Server Preparation​

Step 1: Log In to the Server​

ssh <username>@<server-ip>

Enter the server SSH password.

Step 2: Copy the TBT Package to the Server​

scp -r <package-folder>/ <username>@<server-ip>:~/
cd ~/<package-folder>
ls

Replace <package-folder> with the name of the TBT package folder you received. Make sure the Linux program file (takakrypt-batch-transformation-linux-amd64 or -linux-arm64) and run.sh are present.

Step 3: Run the Program​

chmod +x run.sh takakrypt-batch-transformation-linux-*
./takakrypt-batch-transformation-linux-amd64
  • Use the -linux-arm64 file if the server uses an ARM processor.
  • The program can also be run with ./run.sh, which automatically selects the program matching the server.
  • The results folder and the mapping files created from the menu screen will be saved in the folder where the program is run.

2. Signing In to the Platform​

Step 4: Fill In the Platform Access Data (Authorize)​

The first screen displayed is authorize with the platform. Fill in the following data:

FieldContent
gatewayGateway host name or IP address:port. The path is added automatically by TBT
access tokenAccess token from the Access Token menu in the platform
user keyAccount user key
tenantTenant name; default value is default
  • Press Enter to move to the next field. Pressing Enter on the last field starts the authorization process.
  • Press Esc to quit.
  • Before the access data is sent, TBT tests the gateway address first. If the address is wrong, the process is stopped so that the access token is not sent to the wrong address.

Step 5: Select the "Build a Mapping from a Table" Menu​

After signing in successfully, the what would you like to do? screen displays five menus:

MenuFunction
1. Build a mapping from a tableReads a table, selects columns, then writes the mapping file
2. Open a mappingReviews a mapping, tries it without changing data, or runs it
3. Continue a stopped runContinues a run from the point where it last stopped
4. Retry refused recordsReprocesses only the records refused by the platform, re-read from the database
5. HistoryShows every run in this folder and its final result

For the first job, select 1. Build a mapping from a table and press Enter.


3. Filling In the Database Connection​

Step 6: Fill In the Database Connection​

The database screen asks for the database connection data:

FieldContent
nameConnection (profile) name that the mapping file will use to refer to this connection, example clickhouse
typeDatabase type: mysql, mariadb, postgresql, mssql, oracle, sqlite, or clickhouse
hostDatabase address
portDatabase port
userDatabase user name
databaseDatabase name
schemaSchema (for PostgreSQL and Oracle)
tlsWhether to use a secure connection; default is no
ca certLocation of the database CA certificate, if tls is enabled
passwordDatabase password

Press Enter to move to the next field. Pressing Enter on the last field connects TBT to the database. Press Esc to go back.

Step 7: Select a Table​

TBT displays the list of tables in that database. Type part of a table name to search, use the arrow keys to move, then press Enter to open the table to be processed.

Step 8: Select the Columns to Protect​

TBT displays all table columns along with their data type, method, function, and note:

  • The key column is marked with the note "the key: every row is found by it, so it is never transformed". This column is used to find each row, so it is never changed.
  • TBT suggests functions for columns whose names match a function on the platform (example: "suggests tokenization ... the column name matches Identifier/NIK").
  • Columns without a suggestion are marked "no function on the platform matches this column". Select the function yourself if the column needs to be protected.
KeyFunction
SpaceSelects the column and directly applies the suggested function
EnterSelects a function yourself for that column (see Step 9)
xClears the selection on the column
mChanges the protection method
KSets the key column
sSaves the selection for this table
qBack

Step 9: Select the Protection Function​

Press Enter on a column and the function for <column> screen shows the list of functions from the platform, split into three methods: tokenization, encryption, and masking.

  • Use the left/right arrow keys to switch between methods.
  • Type part of a function name to filter the list.
  • Press Enter to select a function, or Esc to go back.

After all desired columns are selected, press s to save the selection for this table.

Step 10: Add Another Table or Write the Mapping​

TBT returns to the table list. Saved tables are marked with a check mark, and the top of the screen shows the number of tables already selected for this job.

  • To process another table in the same job, open the next table and repeat Steps 8 and 9.
  • When finished, press w to configure the job and write the mapping file.

Step 11: Configure the Job​

The the job screen displays the job settings:

FieldContent
operationprotect (protects data into tokens) or unprotect (restores it)
strategyin_place (changes data directly in the same table) or copy (copies to a destination table)
batchNumber of rows per group; default 250
concurrencyNumber of requests to the gateway running at the same time; default 10
rate limitLimit of requests to the gateway per second; 0 = unlimited

Press Space to switch a choice, and Enter to move to the next field. Pressing Enter on the last field writes the mapping file. The difference between in_place and copy is explained in Two Working Modes.

warning

Masking cannot be undone. A column protected with masking cannot be restored with unprotect.


4. Reviewing and Running the Job​

Step 12: Review the Job​

Before any data is changed, TBT displays the REVIEW — check before anything is written screen and saves the mapping file (example: the message "clickhouse.yaml written" at the bottom of the screen). Check its contents carefully:

SectionMeaning
JobJob name
OperationThe operation and its working mode, example "protect, written over the source column" for in_place
ConnectionsDatabase connections used
MappingFingerprint of the mapping file
AuthorizedAccount and tenant used
TokenAccess token validity period
List of tables and columnsTables, key column, number of rows, as well as the columns, methods, and functions used
SummaryNumber of tables, columns, values, row groups (windows), calls to the gateway, and estimated time
KeyFunction
dDry run: views the job without changing any data
rRuns the job
EscBack to the table list
qQuit
warning

For strategy in_place, the screen displays the message "This overwrites the source columns. The original values are not kept anywhere." Always run a dry run (d) first, and make sure the database has been backed up before pressing r.

Step 13: Confirm Running the Job​

After pressing r, TBT displays a warning that data will be written to the database, along with the mapping file name and its fingerprint. Type yes and press Enter to continue, or press Esc to go back.

Step 14: Monitor the Process​

TBT displays the progress of the process: percentage, number of values processed, speed per second, and estimated remaining time.

KeyFunction
Up/down arrowsScrolls the process log
EndFollows the latest log entries
qStops the process

If the process is stopped or interrupted, the run can be continued through the 3. Continue a stopped run menu. When continuing, TBT first checks the last boundary, for example with the message "the last batch landed; continuing after it", meaning the last group has been saved and the process continues after it.

Step 15: Check the Results​

When finished, open the 5. History menu to see all runs and their final results. The full report of each run is stored in the report.html and summary.json files inside the results folder. See Reading Run Results.

Step 16: Check the Results in the Database​

To make sure the data is protected, open the processed table using a database application (for example DBeaver), then run:

select * from table_name;

Before the job is run, a protected column (example email) still contains the original data, for example user000000@test.com. After the job is run, the same column's contents change into an encrypted value starting with v1:, for example v1:0tXC1k5MinSo/53d.... Other columns that were not selected remain the same, and the number of rows does not change.

note

This example uses the encryption method, so the result is random text longer than the original data. If tokenization with the FF1/FF3-1 format is used, the result can look similar to the original data. See Three Things That Can Cause Data Loss.


The main menu screen (what would you like to do?) has five menus. Steps 6 to 15 above use menu 1.

1. Build a mapping from a table

Creates a new job. TBT reads a table in the database, you pick the columns and their protection functions, and TBT writes the mapping file. Once it's written, TBT jumps straight to the REVIEW screen so you can try it (dry run) or run it.

2. Open a mapping

Opens an existing mapping file, either one created earlier or one already reviewed and approved. From here you can review it (tables, columns, functions, working mode), try it without changing data (dry run), or run it fresh. Reach for this menu to rerun the same job without building the mapping from scratch.

3. Continue a stopped run

Picks up a run that stopped midway, whether from a lost connection or hitting q. It continues from the last safe point instead of starting over.

  • Only shows runs that can still be continued, meaning ones with a checkpoint.
  • A run can only be continued with the exact same mapping file it started with.
  • For strategy in_place, TBT checks the last row group first. If it's proven saved (Landed) or proven not saved (NotLanded), it continues. If that can't be determined (Undecidable), the run stops so data isn't processed twice.

4. Retry refused records

Reprocesses only the records the platform refused in a previous run, without touching the rest of the table. Those values get re-read straight from the database, not from a log file, so it's safe to use.

  • Only shows runs that have refused records (a non-empty failures.jsonl).
  • Use this once you've fixed whatever caused the refusal, for example the function settings on the platform.

5. History

Shows every run in that folder along with its final result: finished, stopped, or with refused records. It only reads the run result folders, with no need for a database, gateway, or access data connection, so its output doubles as proof of execution.

note

Runs that finished completely only appear in the 5. History menu. Menus 3 and 4 only show runs that still need follow-up.


Running Without the Screen (Automation)​

For automated processes (running from a script, say), TBT can be driven entirely with commands, no menu screen needed. Access data comes through environment variables, never through commands, and you can reuse mapping files already created from the menu screen.

a. Prepare the .env File​

Example for a connection profile named prod-corebanking:

# platform access data
TBT_PROD_COREBANKING_ACCESS_TOKEN=<access-token>
TBT_PROD_COREBANKING_USER_KEY=<user-key>
TBT_PROD_COREBANKING_TENANT=default

# database connection
TBT_PROD_COREBANKING_DB_TYPE=postgresql
TBT_PROD_COREBANKING_DB_HOST=localhost
TBT_PROD_COREBANKING_DB_PORT=5432
TBT_PROD_COREBANKING_DB_USER=<db-user>
TBT_PROD_COREBANKING_DB_PASSWORD=<db-password>
TBT_PROD_COREBANKING_DB_NAME=<db-name>

# gateway address
TBT_GATEWAY=<gateway-address>

Restrict file access so that only you can read it:

chmod 600 .env

b. Load .env Into the Terminal​

TBT does not read the .env file automatically. Load its contents every time you open a new terminal session:

set -a; . ./.env; set +a

c. Check, Then Run​

# check the entire mapping
./run.sh validate --mapping mapping.yaml
# show sample original values and their results
./run.sh preview --mapping mapping.yaml
# run without confirmation
./run.sh run --mapping mapping.yaml --yes
  • validate and preview do not change any data. preview shows 5 sample rows by default (set with --sample).
  • Without a screen and without --yes, the run command refuses to change data. This is intentional as a safeguard.
  • A full explanation of each variable is in Access Data, Connections, and Gateway Address.

Want to understand the mapping file in depth? See Mapping File and Working Modes. For how to read results and keep data safe, see Run Results and Data Safety.