Create the database and user
Connect to MariaDB as root and create the database:
The default database name (
xidb), user (xiadmin), and host (127.0.0.1) match settings/default/network.lua. You can change them, but must update the settings file or environment variables to match.Configure database credentials
The server reads credentials from To override without editing the file, set environment variables:
settings/network.lua (or environment variables). The defaults are:Install Python dependencies for dbtool
dbtool.py manages all database imports and migrations. Install its dependencies:Run the initial database import
Import all SQL files and run any pending migrations:On first run against an empty database,
dbtool.py will:- Detect that the database is empty.
- Import all
sql/*.sqlfiles in sorted order (ending withtriggers.sql). - Check and run all pending migrations from
tools/migrations/. - Write the current git commit hash to
tools/config.yamlasdb_ver.
dbtool.py command reference
| Command | Description |
|---|---|
python tools/dbtool.py | Interactive TUI menu |
python tools/dbtool.py update | Express update: import only changed SQL files and run migrations |
python tools/dbtool.py update full | Full update: re-import all SQL files and run migrations |
python tools/dbtool.py migrate | Check and run pending migrations only (no SQL import) |
python tools/dbtool.py backup | Create a full database backup in sql/backups/ |
python tools/dbtool.py backup lite | Back up only player-data tables |
python tools/dbtool.py dump | Dump all non-player tables back to .sql files |
python tools/dbtool.py dump <table> | Dump a single table to its .sql file |