Update database-migration.md

This commit is contained in:
Intelli 2025-09-02 14:59:07 -06:00
parent cec40e384c
commit 252de2f233
2 changed files with 23 additions and 25 deletions

View file

@ -134,7 +134,7 @@ Migrate your CoreProtect database between SQLite and MySQL. Console-only command
| Command | Parameters | | Command | Parameters |
| --- | --- | | --- | --- |
| /co migrate-db | `<sqlite\|mysql>` | | /co migrate-db | `<sqlite|mysql>` |
> **Note:** This feature is exclusive to CoreProtect 23.0+ Patreon builds for Patron supporters. > **Note:** This feature is exclusive to CoreProtect 23.0+ Patreon builds for Patron supporters.

View file

@ -16,11 +16,11 @@ The `/co migrate-db` command allows you to seamlessly transfer all your CoreProt
| Command | Parameters | Description | | Command | Parameters | Description |
| --- | --- | --- | | --- | --- | --- |
| `/co migrate-db` | `<sqlite\|mysql>` | Migrate to the specified database type | | `/co migrate-db` | `<sqlite|mysql>` | Migrate to the specified database type |
**Examples:** **Examples:**
* `/co migrate-db mysql` - Migrate from SQLite to MySQL - `/co migrate-db mysql` - Migrate from SQLite to MySQL
* `/co migrate-db sqlite` - Migrate from MySQL to SQLite - `/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. > **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:** **Before starting the migration:**
1. **Ensure your server is running** with your current CoreProtect database 1. **Ensure your server is running** with your current CoreProtect database
2. **Backup your existing database** (recommended safety measure) 2. **Configure your new database** in `config.yml`:
3. **Configure your target database** in `config.yml`: * For MySQL migration: Set up your new MySQL connection details
* For MySQL migration: Set up your MySQL connection details * Ensure `use-mysql` is updated correctly in your `config.yml`
* For SQLite migration: Ensure the SQLite file path is configured 3. **Important:** Do NOT restart your server or use `/co reload` after modifying the config
4. **Important:** Do NOT restart your server or use `/co reload` after modifying the config
### Step 2: Execute Migration ### 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 <target_type> co migrate-db <mysql|sqlite>
``` ```
2. **Monitor the progress:** #### 2. **Monitor the progress:**
* The migration will display detailed progress information * The migration will display detailed progress information
* Large databases may take considerable time to complete * Large databases may take considerable time to complete
* Progress bars and speed indicators will show current status * 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 * Avoid restarting your server during migration
* Let the process complete naturally * 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:** **After successful completion:**
1. **Automatic switchover:** CoreProtect will automatically begin using the new database 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 3. **Test functionality:** Perform basic CoreProtect operations to verify everything works
4. **Clean up:** Once satisfied, you may manually delete your old database files 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 ### Migration Safety
* **Non-destructive process:** The migration does not modify or delete your existing database * **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 * **Data verification:** The process includes automatic verification to ensure data integrity
### Performance & Requirements ### Performance & Requirements
@ -83,7 +82,6 @@ The `/co migrate-db` command allows you to seamlessly transfer all your CoreProt
### Restrictions & Limitations ### Restrictions & Limitations
* **Console only:** Cannot be executed from in-game chat * **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 * **Interruption handling:** If interrupted, the target database must be manually wiped before restarting
* **Patreon exclusive:** Only available in CoreProtect 23.0+ Patreon builds * **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: If you encounter issues with database migration:
1. **Check server logs** for detailed error messages 1. Check server logs for detailed error messages
2. **Verify database permissions** and connectivity 2. Verify database permissions and connectivity
3. **Ensure adequate system resources** (RAM, CPU, disk space) 3. Ensure adequate system resources (RAM, CPU, disk space)
4. **Contact support** through the CoreProtect Discord with specific error details 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: The migration process includes several advanced features:
* **Batch processing** with dynamic sizing based on performance * Batch processing with dynamic sizing based on performance
* **Automatic retry** mechanisms for temporary failures * Automatic retry mechanisms for temporary failures
* **Data integrity verification** comparing source and target records * Data integrity verification comparing source and target records
* **Progress tracking** with estimated completion times * Progress tracking with estimated completion times
* **Graceful error handling** with detailed logging * Graceful error handling with detailed logging
The migration handles all CoreProtect data types including: The migration handles all CoreProtect data types including:
* Block changes and rollbacks * Block changes and rollbacks