From 252de2f233d9fd2194e24655c925a594f5a17ce1 Mon Sep 17 00:00:00 2001 From: Intelli Date: Tue, 2 Sep 2025 14:59:07 -0600 Subject: [PATCH] Update database-migration.md --- docs/commands.md | 2 +- docs/database-migration.md | 46 ++++++++++++++++++-------------------- 2 files changed, 23 insertions(+), 25 deletions(-) diff --git a/docs/commands.md b/docs/commands.md index 6f2de74..8e97f79 100644 --- a/docs/commands.md +++ b/docs/commands.md @@ -134,7 +134,7 @@ Migrate your CoreProtect database between SQLite and MySQL. Console-only command | Command | Parameters | | --- | --- | -| /co migrate-db | `` | +| /co migrate-db | `` | > **Note:** This feature is exclusive to CoreProtect 23.0+ Patreon builds for Patron supporters. diff --git a/docs/database-migration.md b/docs/database-migration.md index 939bd60..fc85031 100644 --- a/docs/database-migration.md +++ b/docs/database-migration.md @@ -16,11 +16,11 @@ The `/co migrate-db` command allows you to seamlessly transfer all your CoreProt | Command | Parameters | Description | | --- | --- | --- | -| `/co migrate-db` | `` | Migrate to the specified database type | +| `/co migrate-db` | `` | Migrate to the specified database type | **Examples:** -* `/co migrate-db mysql` - Migrate from SQLite to MySQL -* `/co migrate-db sqlite` - Migrate from MySQL to SQLite +- `/co migrate-db mysql` - Migrate from SQLite to MySQL +- `/co migrate-db sqlite` - Migrate from MySQL to SQLite > **Console Only:** This command can only be executed from the server console, not from in-game. @@ -33,25 +33,24 @@ The `/co migrate-db` command allows you to seamlessly transfer all your CoreProt **Before starting the migration:** 1. **Ensure your server is running** with your current CoreProtect database -2. **Backup your existing database** (recommended safety measure) -3. **Configure your target database** in `config.yml`: - * For MySQL migration: Set up your MySQL connection details - * For SQLite migration: Ensure the SQLite file path is configured -4. **Important:** Do NOT restart your server or use `/co reload` after modifying the config +2. **Configure your new database** in `config.yml`: + * For MySQL migration: Set up your new MySQL connection details + * Ensure `use-mysql` is updated correctly in your `config.yml` +3. **Important:** Do NOT restart your server or use `/co reload` after modifying the config ### Step 2: Execute Migration -1. **Run the migration command** from your server console: +#### 1. **Run the migration command from your server console:** ``` - co migrate-db + co migrate-db ``` -2. **Monitor the progress:** +#### 2. **Monitor the progress:** * The migration will display detailed progress information * Large databases may take considerable time to complete * Progress bars and speed indicators will show current status -3. **Do not interrupt the process:** +#### 3. **Do not interrupt the process:** * Avoid restarting your server during migration * Let the process complete naturally @@ -60,7 +59,7 @@ The `/co migrate-db` command allows you to seamlessly transfer all your CoreProt **After successful completion:** 1. **Automatic switchover:** CoreProtect will automatically begin using the new database -2. **Verify configuration:** Ensure `use-mysql` is set correctly in your `config.yml` +2. **Verify configuration:** Ensure `use-mysql` is set correctly in your `config.yml` as per step 1 3. **Test functionality:** Perform basic CoreProtect operations to verify everything works 4. **Clean up:** Once satisfied, you may manually delete your old database files @@ -71,7 +70,7 @@ The `/co migrate-db` command allows you to seamlessly transfer all your CoreProt ### Migration Safety * **Non-destructive process:** The migration does not modify or delete your existing database -* **Rollback capability:** If something goes wrong, simply delete the new database and continue using the old one +* **Interrupted migration:** If something goes wrong, simply delete the new database and continue using the old one * **Data verification:** The process includes automatic verification to ensure data integrity ### Performance & Requirements @@ -83,7 +82,6 @@ The `/co migrate-db` command allows you to seamlessly transfer all your CoreProt ### Restrictions & Limitations * **Console only:** Cannot be executed from in-game chat -* **Single direction:** Cannot migrate to the same database type currently in use * **Interruption handling:** If interrupted, the target database must be manually wiped before restarting * **Patreon exclusive:** Only available in CoreProtect 23.0+ Patreon builds @@ -117,10 +115,10 @@ The `/co migrate-db` command allows you to seamlessly transfer all your CoreProt If you encounter issues with database migration: -1. **Check server logs** for detailed error messages -2. **Verify database permissions** and connectivity -3. **Ensure adequate system resources** (RAM, CPU, disk space) -4. **Contact support** through the CoreProtect Discord with specific error details +1. Check server logs for detailed error messages +2. Verify database permissions and connectivity +3. Ensure adequate system resources (RAM, CPU, disk space) +4. Contact support through the CoreProtect Discord with specific error details --- @@ -128,11 +126,11 @@ If you encounter issues with database migration: The migration process includes several advanced features: -* **Batch processing** with dynamic sizing based on performance -* **Automatic retry** mechanisms for temporary failures -* **Data integrity verification** comparing source and target records -* **Progress tracking** with estimated completion times -* **Graceful error handling** with detailed logging +* Batch processing with dynamic sizing based on performance +* Automatic retry mechanisms for temporary failures +* Data integrity verification comparing source and target records +* Progress tracking with estimated completion times +* Graceful error handling with detailed logging The migration handles all CoreProtect data types including: * Block changes and rollbacks