-
Notifications
You must be signed in to change notification settings - Fork 0
Storage and Backups
RoyalBank stores accounts, balances, tiers, transactions, and anti-abuse state in a single SQLite file:
plugins/RoyalBank/bank.db
The file name is set by database.file in config.
You'll also see bank.db-wal and bank.db-shm alongside it — those are the write-ahead log and shared-memory files SQLite uses in WAL mode. They're normal; don't delete them while the server is running.
- Every money operation moves through Vault and persists the balance in a single database transaction. If the write fails, the Vault side is rolled back — money is never created or destroyed by a half-completed operation.
- Online players' accounts are cached in memory (loaded on join, evicted on quit). GUIs and PlaceholderAPI read the cache, not the database, so normal play doesn't hammer disk.
- The database uses WAL mode with a busy timeout, so reads and writes don't block each other.
- Transaction pruning and backups run asynchronously on dedicated connections, off the main thread.
- Existing databases are migrated automatically on startup as new columns are introduced — no manual schema steps.
/bank admin backup
- Backups are written to
plugins/RoyalBank/backups/. - The command uses SQLite
VACUUM INTOrather than copying the live file, so you get a clean, consistent snapshot even while the server is running (a raw file copy of an active WAL database can be corrupt). - It runs off the main thread, so backing up a large database doesn't stall the server or cause lag.
- Run
/bank admin backupbefore major config edits, plugin updates, or economy changes. - For scheduled backups, trigger
/bank admin backupfrom a command-scheduler plugin (or copy thebackups/folder off-server on your own cron).
- Stop the server.
- Replace
plugins/RoyalBank/bank.dbwith the backup file (rename it back tobank.db). - Delete any stale
bank.db-wal/bank.db-shmnext to it. - Start the server.
RoyalBank uses SQLite. It's more than enough for a single server — SQLite handles a Minecraft server's account load comfortably, and WAL mode keeps it responsive. (The companion plugins RoyalAuctions and RoyalBazaar offer MySQL for network-wide shared data; RoyalBank's accounts are per-server.)
- Keep
transactions.max-per-playerat a sane number (default 100) so the transaction table can't grow without bound. Pruning runs on startup whentransactions.prune-on-startupis true. - Don't hand-edit
bank.dbwhile the server is running. Use the admin commands, or stop the server first.
RoyalBank · part of the eco suite (RoyalAuctions · RoyalBazaar · EconGuard) · Source on GitHub
Getting started
Using it
- Bank Tiers & Interest
- Upgrade Costs
- GUI Customization
- Anti-Abuse & RMT Detection
- PlaceholderAPI
- EconGuard Integration
- Storage & Backups
Help