Skip to content
This repository was archived by the owner on May 26, 2026. It is now read-only.

Latest commit

 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TNE -> EconomyPol Migrator

This tool is being archived as the migration has long since been completed successfully.

Standalone Python tool for migrating TNE shared/non-player accounts into EconomyPol.

Behavior:

  • reads all runtime settings from migration.yml
  • writes a human-readable migration.log
  • supports inspect, dry_run, and apply
  • bootstraps the target EconomyPol schema from the bundled schema/V1__init.sql during apply
  • migrates shared accounts only
  • preserves shared account names, owner UUID metadata, balances, and member existencern- ignores legacy TNE shared-account rows whose username contains expired
  • intentionally discards TNE per-member permission detail because EconomyPol no longer stores it

Dependencies are listed in requirements.txt.

Entrypoint:

python migrate.py

The tool expects migration.yml to live next to migrate.py. A sample config is provided in migration.yml.example.

Configuration notes:

  • the tool builds the SQLAlchemy connection URL for you
  • set host, port, database, user, and password for both source and target
  • host may be an IP address or hostname

Run Modes

inspect

inspect is a read-only preflight mode.

It:

  • validates the source and target database connections
  • checks that the required TNE tables exist
  • lists the available TNE currencies
  • reads shared accounts, region totals, balances, and member-permission rows
  • builds the migration plan
  • validates the target preflight conditions if the EconomyPol schema is already present
  • writes the findings to migration.log

It does not write anything to the EconomyPol database.

If the EconomyPol schema is not present yet, inspect logs that apply would create it from the bundled schema/V1__init.sql.

dry_run

dry_run does everything inspect does, plus writes the full planned migration actions to migration.log.

That includes:

  • the shared accounts that would be inserted
  • the floored target balances
  • the member relationships that would be imported
  • the warnings for skipped or downgraded permission data
  • whether the target schema would need to be bootstrapped first

It does not write anything to the EconomyPol database.

apply

apply performs the real migration.

It:

  • reruns the same validation and planning work as dry_run
  • creates the EconomyPol schema from the bundled schema/V1__init.sql if the target tables do not already exist
  • opens a target transaction
  • inserts any missing referenced player rows into economy_players
  • inserts shared accounts into economy_accounts
  • inserts balances into economy_balances
  • inserts deduplicated member relationships into economy_account_members
  • writes the applied results and insert counts to migration.log

If validation fails before the write step, nothing is imported.

About

DEATH TO TNE

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages