From 0b29de9efc3acdf4e5eaaab6dd77461683ff8080 Mon Sep 17 00:00:00 2001 From: William Date: Sun, 23 Jun 2024 15:49:28 +0100 Subject: [PATCH] fix: update documentation, help menu access for migrators --- .../java/net/william278/husksync/migrator/MpdbMigrator.java | 4 ++-- .../net/william278/husksync/command/HuskSyncCommand.java | 4 ++++ docs/Legacy-Migration.md | 6 +++--- docs/MPDB-Migration.md | 6 +++--- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/bukkit/src/main/java/net/william278/husksync/migrator/MpdbMigrator.java b/bukkit/src/main/java/net/william278/husksync/migrator/MpdbMigrator.java index 4fb2d8db..5a8eea05 100644 --- a/bukkit/src/main/java/net/william278/husksync/migrator/MpdbMigrator.java +++ b/bukkit/src/main/java/net/william278/husksync/migrator/MpdbMigrator.java @@ -255,7 +255,7 @@ public class MpdbMigrator extends Migrator { If any of these are not correct, please correct them using the command: "husksync migrate mpdb set " - (e.g.: "husksync migrate mpdb set host 1.2.3.4") + (e.g.: "husksync migrate set mpdb host 1.2.3.4") STEP 3] HuskSync will migrate data into the database tables configures in the config.yml file of this @@ -263,7 +263,7 @@ public class MpdbMigrator extends Migrator { before proceeding. STEP 4] To start the migration, please run: - "husksync migrate mpdb start" + "husksync migrate start mpdb" NOTE: This migrator currently WORKS WITH MPDB version v4.9.2 and below! diff --git a/common/src/main/java/net/william278/husksync/command/HuskSyncCommand.java b/common/src/main/java/net/william278/husksync/command/HuskSyncCommand.java index 77cbc3c7..62a45350 100644 --- a/common/src/main/java/net/william278/husksync/command/HuskSyncCommand.java +++ b/common/src/main/java/net/william278/husksync/command/HuskSyncCommand.java @@ -160,6 +160,10 @@ public class HuskSyncCommand extends PluginCommand { .collect(Collectors.joining("\n")) )); }); + sub.addSubCommand("help", (help) -> help.addSyntax((cmd) -> { + final Migrator migrator = cmd.getArgument("migrator", Migrator.class); + plugin.log(Level.INFO, migrator.getHelpMenu()); + }, migrator())); sub.addSubCommand("start", (start) -> start.addSyntax((cmd) -> { final Migrator migrator = cmd.getArgument("migrator", Migrator.class); migrator.start().thenAccept(succeeded -> { diff --git a/docs/Legacy-Migration.md b/docs/Legacy-Migration.md index 483ec681..c2193601 100644 --- a/docs/Legacy-Migration.md +++ b/docs/Legacy-Migration.md @@ -18,12 +18,12 @@ This guide will walk you through how to upgrade from HuskSync v1.4.x to HuskSync ### 3. Configure the migrator - With your servers back on and correctly configured to run HuskSync v3.x, ensure nobody is online. -- Use the console on one of your Spigot servers to enter: `husksync migrate legacy` -- Carefully read the migration configuration instructions. In most cases, you won't have to change the settings, but if you do need to adjust them, use `husksync migrate legacy set `. +- Use the console on one of your Spigot servers to enter: `husksync migrate help legacy` +- Carefully read the migration configuration instructions. In most cases, you won't have to change the settings, but if you do need to adjust them, use `husksync migrate set legacy `. - Migration will be carried out *from* the database you specify with the settings in console *to* the database configured in `config.yml`. If you're migrating from multiple clusters, ensure you run the migrator on the correct servers corresponding to the migrator. ### 4. Start the migrator -- Run `husksync migrate legacy start` to begin the migration process. This may take some time, depending on the amount of data you're migrating. +- Run `husksync migrate start legacy` to begin the migration process. This may take some time, depending on the amount of data you're migrating. ### 5. Ensure the migration was successful - HuskSync will notify in console when migration is complete. Verify that the migration went OK by logging in and using the `/userdata list ` command to see if the data was imported with the `legacy migration` saveCause. diff --git a/docs/MPDB-Migration.md b/docs/MPDB-Migration.md index cf8f71e6..a07d6c0a 100644 --- a/docs/MPDB-Migration.md +++ b/docs/MPDB-Migration.md @@ -13,12 +13,12 @@ This guide will walk you through how to migrate from MySQLPlayerDataBridge (MPDB ### 2. Configure the migrator - With your servers back on and correctly configured to run HuskSync v3.x, ensure nobody is online. -- Use the console on one of your Spigot servers to enter: `husksync migrate mpdb`. If the MPDB migrator is not available, ensure MySQLPlayerDataBridge is still installed. -- Adjust the migration setting as needed using the following command: `husksync migrate mpdb set `. +- Use the console on one of your Spigot servers to enter: `husksync migrate help mpdb`. If the MPDB migrator is not available, ensure MySQLPlayerDataBridge is still installed. +- Adjust the migration setting as needed using the following command: `husksync migrate set mpdb `. - Note that migration will be carried out *from* the database you specify with the settings in console *to* the database configured in `config.yml`. ### 3. Start the migrator -- Run `husksync migrate mpdb start` to begin the migration process. This may take some time, depending on the amount of data you're migrating. +- Run `husksync migrate start mpdb` to begin the migration process. This may take some time, depending on the amount of data you're migrating. ### 4. Uninstall MySQLPlayerDataBridge - HuskSync will display a message in console when data migration is complete.