Skip to content

GriefPrevention

bloodmc edited this page May 16, 2022 · 17 revisions

⚠️ Before using GriefPrevention migrator, backup your data (including LuckPerms).
It is recommended to test migration on a test server before applying to production to ensure everything works as expected.
⚠️ All player data that contains accrued claim blocks and bonus claim blocks will be stored as meta in LuckPerms when migrator is finished.
⚠️ Converting a GP SQL Database back to file storage can be done with the python script found here, alter the database connection details in the script.
Note: GD 2.X supports migration from GP Database so it is no longer needed to convert back to file storage.

Accrued claim blocks will use meta key griefdefender.accrued-blocks
Bonus claim blocks will use meta key griefdefender.bonus-blocks
See https://github.com/lucko/LuckPerms/wiki/Prefixes,-Suffixes-&-Meta#meta for more info

Bukkit

GriefDefender supports a complete migration from GriefPrevention Bukkit. To migrate to GriefDefender, perform the following steps

  1. Add GriefDefender jar to plugins
  2. Remove GriefPrevention jar from plugins
  3. Start the server to generate GriefDefender configs.
  4. Stop server
  5. Edit global.conf under ./plugins/GriefDefender/
  6. Locate section
# List of migrators that convert old or other protection data into the current GD claim data format.
# Note: It is recommended to backup data before using.
migrator {
        # Set to true to enable the classic migrator.
        # Note: Migrates GP bukkit classic claim data and GPFlags data, if available, to current format.
        # Note: It is recommended to backup data before using.
        classic=false
        classic-database {
            # The database address and port. Use format host:port.
            address=localhost
            # The GriefPrevention database name.
            database=""
            # Set to true to enable the classic database migrator.
            # Note: Migrates GriefPrevention bukkit classic database data and GPFlags data, if available, to current format.
            # Note: It is recommended to backup data before using.
            enabled=false
            # The GriefPrevention database password
            password=""
            # The GriefPrevention database username.
            username=""
        }
}

7a. If migrating from GP file-format, set classic to true
OR
⚠️ This step requires storage.conf to be configured for GD database.
7b. If migrating from GP database, configure classic-database section.
8. Start Server
If done properly, GriefDefender will migrate all data from plugins/GriefPreventionData to plugins/GriefDefender.
Migration output should appear in console as it is migrating.
9. Disable the migrator in global.conf

Sponge

⚠️ The migrator will not copy the global.conf as there have been many changes to it in GriefDefender. You will have to manually copy the settings you want from GP's global.conf to GD.
⚠️ Make sure GriefPreventionData exists in ./plugins/ folder. If migrating from Bukkit, you must copy GriefPreventionData to ./plugins/

  1. Add GriefDefender jar to mods or plugins folder
  2. Remove GriefPrevention jar from mods/plugins folder
  3. Start the server to generate GriefDefender configs.
  4. Stop server
  5. Edit global.conf under ./plugins/GriefDefender/
  6. Locate section
# List of migrators that convert old or other protection data into the current GD claim data format.
# Note: It is recommended to backup data before using.
migrator {
    # Set to true to enable the griefprevention bukkit migrator.
    # Note: Migrates GP bukkit classic claim data and GPFlags data, if available, to current format.
    # Note: It is recommended to backup data before using.
    griefprevention-bukkit=false
    # Set to true to enable the griefprevention sponge migrator.
    # Note: Migrates GP sponge claim data to current format.
    # Note: It is recommended to backup data before using.
    griefprevention-sponge=false
    # Set to true to enable the legacy playerdata file migrator.
    # Note: Migrates legacy playerdata file format to permissions storage such as LuckPerms json or mysql storage.
    # Note: Before turning this on, make sure you properly set 'context-storage-type' in the the playerdata section of this config.
    # Note: It is HIGHLY recommended to backup your permissions database before running this migrator as all local playerdata files will be migrated to it.
    # Note: Do NOT run this migrator on more than one server if multiple servers share the same permissions database.
    playerdata=false
    # Set to true to enable RedProtect data migrator.
    # Note: All RedProtect data will be converted into basic claim data.
    red-protect=false
    # Set to true to enable WorldGuard data migrator.
    # Note: Only cuboid regions are supported.
    # Note: It is recommended to backup data before using.
    worldguard=false
}
  1. Set griefprevention-sponge to true or griefprevention-bukkit to true if migrating from Bukkit.
  2. If migrating from GP Sponge, set 'playerdata' to true.
    Note: Make sure to read the comment carefully as there are things to check before turning on the migrator.
  3. Locate section
playerdata {
    # Determines which claim block system to use for claims. (Default: AREA)
    # If set to VOLUME, claim blocks will use the chunk count system to balance 3d claiming.
    # If set to AREA, the standard 2d block count system will be used.
    claim-block-system=AREA
    # The context type used when storing playerdata within a permissions database.
    # Available types are : global, server, world. (Default: global)
    # Global will store data globally shared by all servers.
    # Server will store data per server. Note: This requires servername to be properly set in permissions config.
    # World will store data per world.
    context-storage-type=global
    ...
}
  1. context-storage-type needs to be set to global, server, or world. Read comment for more information.
  2. Start server
    If done properly, GriefDefender will migrate all data from plugins/GriefPreventionData to plugins/GriefDefender including permission data.
    Migration output should appear in console as it is migrating.
  3. Disable the migrator in global.conf