-
-
Notifications
You must be signed in to change notification settings - Fork 171
Database management
Risto Lahtela edited this page Apr 16, 2021
·
13 revisions
This article covers how to modify data in the database.
- Moving data from SQLite to MySQL
- Backup and restore
- Removing a player
- Removing a server
- Resetting one server's data
- Removing data of a bot attack
Perhaps you want to migrate the database to MySQL.
- Set up your MySQL
- After Plan is using MySQL run
/plan db move SQLite MySQL
/plan reload
- To back up the current database run
/plan db backup
- To restore from a backup use
/plan db restore <backup file name>
. You can tab complete the file names.
Command /plan db remove <player>
, takes the name or UUID of the player to be removed.
Command /plan db uninstalled <server>
, takes id, name or UUID of the server to be removed. You can use /plan servers
to get the IDs.
Maybe you have multiple servers in your network so /plan db clear
is not good (it deletes ALL data).
- Remove
ServerInfoFile.yml
of the server you want to reset -
/plan reload
that server to get a new UUID for the server -
/plan db uninstalled <old server>
to remove the old server. You can use/plan servers
to get the IDs.
A bot attack usually messes up the peak calculations. Removing that data needs manual SQL query to the database.
DELETE FROM plan_tps WHERE date>{start} AND date<{end} AND players_online>{above value};
Replace the variables in {square brackets}
(remove the brackets as well)
-
start
is epoch millisecond of the start time of the attack -
end
is epoch millisecond of the end time of the attack -
above value
should be above 0, use it to further limit what data is removed.