Migrating to a new Storage Type
You can migrate storage types without losing any data.
Steps
- Make sure no one is using the plugin while you are changing the storage type.
- Export the data from the current storage type using
/lifestealer export
.- A file named
lifestealer_users_<date>.json
will be created under theexports
folder in the plugin folder. - You can also name this file by providing a name after the command (e.g.
/lifestealer export data-from-mysql
).
- A file named
- Stop the server.
- Change the storage type in the
config.yml
file (see Storage Options). - Start the server.
- Check if the plugin started successfully (the plugin won't start if it couldn't connect to the database).
- Import the data using
/lifestealer import <path>
, where<path>
is the path to the exported data file, relative to theexports
folder.- You should be able to autocomplete the path using tab completion.
- Done.
Generated Export File Format
json
[
{
"uuid": "e0980be7-b682-3dce-af99-a5d35421e77c",
"hearts": 10,
"modifierRules": {
"maxHearts": 0,
"minHearts": 0,
"banTime": {
"seconds": 0,
"nano": 0
},
"returnHearts": 0
}
},
{
"uuid": "57893787-d0d1-42e0-b7bd-becb1234743f",
"hearts": 15,
"modifierRules": {
"maxHearts": 0,
"minHearts": 0,
"banTime": {
"seconds": 0,
"nano": 0
},
"returnHearts": 0
}
}
]