Skip to content

Database Setup

Configuration file: plugins/DonutSMPCore/storage.yml

Storage modes

Global (default)

All modules share one database connection:

mode: global
method: SQLITE   # or MYSQL, MONGODB

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

mode: global
method: SQLITE
  • 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
mode: global
method: MONGODB
mongodb:
  uri: "mongodb://localhost:27017"
  database: "donutsmpcore"

Supports auth and replica sets via the connection URI.

Switching backends

Use the built-in storage transfer commands:

/donutsmpcore storage export my-backup
  1. Export current data to plugins/DonutSMPCore/storage-exports/
  2. Stop server
  3. Edit storage.yml (change method, credentials)
  4. Start server
  5. Import:
/donutsmpcore storage export list
/donutsmpcore storage import my-backup

Requires donutsmpcore.storage.admin.

Cross-server requirement

Redis network features require:

method: MYSQL

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