Database Setup¶
Configuration file: plugins/DonutSMPCore/storage.yml
Storage modes¶
Global (default)¶
All modules share one database connection:
Per-module¶
Each module can override its backend:
mode: per-module
method: SQLITE
module:
auction:
method: MYSQL
mysql:
host: "db.example.com"
database: "donut_auction"
username: "donut"
password: "secret"
Backends¶
- No external service required
- Database file stored in plugin data folder
- Not suitable for multi-server networks
mode: global
method: MYSQL
mysql:
host: "localhost"
port: 3306
database: "donutsmp"
username: "root"
password: ""
ssl: false
- Required for Redis cross-server
- All backends must use the same database credentials
Switching backends¶
Use the built-in storage transfer commands:
- Export current data to
plugins/DonutSMPCore/storage-exports/ - Stop server
- Edit
storage.yml(changemethod, credentials) - Start server
- Import:
Requires donutsmpcore.storage.admin.
Cross-server requirement¶
Redis network features require:
on every backend, with identical connection settings. If mode: per-module, every module override must also use MYSQL.
The plugin checks this on network startup and warns if requirements are not met.
Tables¶
DonutSMPCore creates tables automatically per module on first connect. No manual SQL migrations are required for normal operation.
Troubleshooting¶
| Issue | Fix |
|---|---|
| Module fails on startup | Check MySQL credentials, firewall, SSL setting |
| Data not shared across servers | Verify same database name on all backends |
| Network disabled | Ensure method: MYSQL in storage.yml |