Get Nexal Leaderboards on the Nexal Studios store
Storage and Backups
Everything the plugin remembers (scores, score history, holograms, signs, heads, NPCs, who is
excluded, which rewards were paid and which are waiting for offline players) is kept in one
place: a JSON file, or a MySQL or MariaDB database. Your settings are in config.yml and
messages.yml, which are separate.
JSON or SQL?
| JSON | MySQL or MariaDB | |
|---|---|---|
| Setup | Nothing, it is the default | A database and its login |
| Where | plugins/NexalLeaderboards/data.json | The leaderboards_* tables |
| Good for | Most servers | Big servers, long history, or when you already back up a database |
Either way, saving happens off the main thread, so it never lags the server. The tables are listed on the Overview page.
Switching to SQL
-
Export what you have:
/lb admin→ Export Data. This writes every record toplugins/NexalLeaderboards/export/. -
In
config.yml, set the storage:storage:
type: sql
sql:
host: localhost
port: 3306
database: minecraft
username: minecraft
password: "your password" -
/lb admin→ Reload. The plugin connects and creates its tables. If it cannot connect, it says so and stays on JSON: nothing is lost. -
/lb admin→ Import Data, with a shift left click (so it is never clicked by accident).
Done. Switching back to JSON is the same four steps with type: json.
Backups
- Export Data writes a full copy to the
export/folder at any time, while the server runs. Keep a copy of that folder somewhere else. - JSON: you can also copy
data.jsonwhile the server is stopped. - SQL: the tables are part of your normal database backups.
To restore, put the export files back in export/ and click Import Data.
What Import does
Import saves every record of the export into the current storage. A record that already exists with the same ID (the same player on the same leaderboard, the same hologram name) is replaced by the one in the export; everything else is kept. So importing twice is safe, and importing an old backup puts the old values back for the players in it.
Moving to another server
Export on the old server, copy export/ to the new server's plugins/NexalLeaderboards/, and
import there. Copy config.yml as well to keep your periods, formats and rewards.