Astral Realms Documentation Help

LiteBans Import

A server moving from LiteBans brings its punishment record with it. The plugin repository ships three SQL scripts under tools/litebans-import/, run in order against the AstralPunishments database with the LiteBans database readable from the same connection:

Script

Mode

Does

01-preflight.sql

reads only

Reports what the source data looks like and what cannot survive the conversion.

02-import.sql

writes

The conversion itself. Idempotent.

03-verify.sql

reads only

Imported vs. expected, per type.

Take a backup first. The import does not delete, but it is not a dry run either.

Before running

  • Source location. Every reference reads litebans.litebans_<table>. If the schema or table prefix differs, replace the string litebans.litebans_ throughout all three scripts.

  • Any client will do — CLI, DBeaver, the IntelliJ console, phpMyAdmin. There is deliberately no DELIMITER anywhere: that is a command-line-client feature, and a script using it fails on line 1 through JDBC. The two helper functions are written as a single RETURN expression so no custom delimiter is needed.

  • Run the whole of 02 on one connection — it creates a temporary table and wraps the inserts in a transaction.

Type mapping

LiteBans

AstralPunishments

litebans_bans, ipban = 0

type = 0 (BAN)

litebans_bans, ipban = 1

type = 0 and type = 1 — two rows

litebans_mutes

type = 2 (MUTE)

litebans_kicks

type = 3 (KICK)

litebans_warnings

type = 4 (WARN)

A LiteBans IP ban carries both an account and an address, which this schema models as two rows: the account ban and the address ban. tools/litebans-import/README.md covers that split, identifier derivation, and everything that does not map cleanly.

See also

Last modified: 25 September 2026