Migration to v1.9.0
Step-by-step guide for upgrading Dime Skills from v1.7.x to v1.9.0
Migrating to v1.9.0
Complete guide for upgrading Dime Skills from v1.7.x to v1.9.0.
CRITICAL: Backup your database before proceeding! This migration modifies your database structure.
Overview
Version 1.9.0 introduces a new normalized database structure and requires migration from the old JSON column format. This guide walks you through the entire process safely.
Time Required: 15-30 minutes
Downtime: Minimal (depends on player count)
Reversible: Yes (with backup)
Prerequisites
Before starting the migration:
- Currently running v1.7.x
- Database access (MySQL/MariaDB)
- Server console access
- Backup capability
- Test environment (recommended)
Step 1: Backup Everything
Never skip backups! This is your safety net if something goes wrong.
Database Backup
# Full database backup
mysqldump -u root -p your_database > dime_skills_backup_$(date +%Y%m%d).sql
# Verify backup was created
ls -lh dime_skills_backup_*.sqlResource Backup
# Backup current resource
cp -r resources/dime_skills resources/dime_skills_v17_backup
# Or on Windows
xcopy /E /I resources\dime_skills resources\dime_skills_v17_backupStep 2: Test in Development (Recommended)
If you have a test/development server, run the migration there first.
- Restore database backup to test server
- Deploy v1.9.0 files
- Run migration
- Verify everything works
- Then proceed with production
Step 3: Stop Your Server
# Stop FiveM server gracefully
# Ensure all players are disconnected
# Allow time for final data savesDon't skip this step! Running the migration on a live server can cause data corruption.
Step 4: Update Resource Files
Download v1.9.0
- Download latest version from your purchase source
- Extract the archive
Replace Files
# Remove old resource (after backing up!)
rm -rf resources/dime_skills
# Copy new version
cp -r dime_skills_v1.9.0 resources/dime_skills
# Or on Windows
rmdir /s resources\dime_skills
xcopy /E /I dime_skills_v1.9.0 resources\dime_skillsPreserve Your Configuration
Compare your old config.lua with the new structure and migrate your settings.
Changes in config:
disableSafetyCheckremoved (always enabled now)- New
GlobalMultiplierssection added - Better organization and comments
Step 5: Start Server
Start your server normally:
# The resource will detect the old database structure
# It will NOT automatically migrate - you control whenWhen the server starts, you'll see:
[Dime Skills] Old database structure detected
[Dime Skills] Run 'migrate_skills' command to upgrade to v1.9.0Step 6: Run Migration
Automatic Migration (Recommended)
In your server console:
migrate_skillsThe migration process will:
- Create backup table (
player_skills_backup_v17) - Create new tables (normalized structure)
- Migrate all data (preserves levels, XP, statlevel)
- Verify integrity (shows summary)
Expected Output
[Dime Skills Migration] Creating backup of old table...
✓ Backup created successfully!
[Dime Skills Migration] Creating new normalized tables...
✓ New tables created successfully!
[Dime Skills Migration] Migrating player data...
✓ Migrated 1543 players with 0 errors!
[Dime Skills Migration] Total Players: 1543
[Dime Skills Migration] Total Skill Entries: 16973
[Dime Skills Migration] Skill Statistics:
driving: 1543 players, Avg Level: 12.50, Avg XP: 450.25
shooting: 1543 players, Avg Level: 8.30, Avg XP: 320.10
...
========================================
✓ Migration completed successfully!
========================================Manual Migration (Alternative)
If you prefer SQL, run migration.sql directly:
mysql -u root -p your_database < migration.sqlStep 7: Verify Migration
Run the verification script:
test_migrationVerification Tests
The script runs 10 automated tests:
- ✓ Check new tables exist
- ✓ Check backup table exists
- ✓ Compare player counts
- ✓ Verify skill data migrated
- ✓ Check for data loss
- ✓ Verify indexes exist
- ✓ Check foreign keys
- ✓ Check for orphaned data
- ✓ Performance test
- ✓ Data type verification
Expected Result
========================================
[Test Results]
========================================
Passed: 10
Failed: 0
Warnings: 0
✓ All tests passed! Migration successful.
You can now safely use v1.9.0
Note: You can delete player_skills_backup_v17 after confirming everything works.
========================================If any tests fail, DO NOT proceed! Check the error messages and consider rolling back.
Step 8: Update Custom Scripts
If you have custom resources using Dime Skills, update them:
Export Name Changes
-- Old (still works but deprecated)
local skills = exports.dime_skills:grabSkills(source)
local skill = exports.dime_skills:grabSkill(source, 'driving')
exports.dime_skills:addEXP(source, 'driving', 100)
exports.dime_skills:remoEXP(source, 'driving', 50)
-- New (recommended)
local skills = exports.dime_skills:getSkills(source)
local skill = exports.dime_skills:getSkill(source, 'driving')
exports.dime_skills:addXP(source, 'driving', 100)
exports.dime_skills:removeXP(source, 'driving', 50)Remove Manual Sync
-- Old (no longer needed - remove this)
TriggerClientEvent('dime_skills:sendPlayerSkills', source, skillData)
-- New (automatic via statebags - no code needed)
-- Skills sync automatically when changed!Step 9: Test Thoroughly
Before announcing to players:
Functional Tests
- Players can log in
- Skills display correctly in UI
- XP gains work properly
- Level ups trigger correctly
- Skill requirements work
- ox_inventory integration (if used)
Join Server Tests
- Log in with test character
- Open skills UI (
/skillsor U key) - Verify your skills are correct
- Do actions that give XP
- Check level progression
- Test with multiple players
Database Verification
-- Check player count
SELECT COUNT(*) FROM player_skills;
-- Check skill data
SELECT skill_name, COUNT(*) as players, AVG(level) as avg_level
FROM player_skill_data
GROUP BY skill_name;
-- Spot check a player
SELECT * FROM player_skill_data WHERE citizenID = 'ABC12345';Step 10: Monitor & Optimize
After migration:
Monitor Performance
- Watch server console for errors
- Check database query times
- Monitor memory usage
- Gather player feedback
Optional Cleanup
After confirming everything works for 24-48 hours:
-- Remove backup table (ONLY after confirming everything works!)
DROP TABLE IF EXISTS player_skills_backup_v17;Keep the backup table for at least a week before deleting it.
Troubleshooting
Rollback Procedure
If something goes wrong and you need to revert:
Only rollback if you encounter critical issues. Test thoroughly before deciding.
Step 1: Stop Server
# Stop FiveM serverStep 2: Restore Database
-- Remove new tables
DROP TABLE IF EXISTS player_skill_data;
DROP TABLE IF EXISTS player_skills;
-- Restore from backup
RENAME TABLE player_skills_backup_v17 TO player_skills;Or restore from SQL backup:
mysql -u root -p your_database < dime_skills_backup_YYYYMMDD.sqlStep 3: Restore v1.7.x Files
# Restore old resource files
rm -rf resources/dime_skills
cp -r resources/dime_skills_v17_backup resources/dime_skillsStep 4: Restart Server
Your server is now back to v1.7.x state.
Post-Migration Checklist
After successful migration:
- All tests pass
- Skills display correctly
- XP gains work
- Level ups function
- Multiple players tested
- No console errors
- Performance is good
- Custom scripts updated
- Documentation updated
- Players informed of changes
- Backup retained for 1 week
Getting Help
If you encounter issues:
Before Asking for Help
- Run
test_migrationand save output - Enable
Debug = truein config - Check F8 and server console for errors
- Note your FiveM version and artifacts
- Document exact steps that cause issues
Support Channels
- Discord Community - Fastest response
- Troubleshooting Guide
- Direct support (check your purchase source)
Information to Provide
- FiveM Version: (artifacts version)
- Framework: (QBOX/ESX/etc)
- Server OS: (Windows/Linux)
- Player Count: (approximate)
- Migration Method: (automatic/manual)
- Test Results: (test_migration output)
- Error Messages: (exact text)
- Steps to Reproduce: (detailed)FAQ
Q: How long does migration take?
A: 5-15 minutes for most servers. Depends on player count.
Q: Will players lose progress?
A: No! All skill data is preserved (levels, XP, statlevel).
Q: Can I migrate with players online?
A: Not recommended. Stop server and migrate offline for safety.
Q: Is the migration reversible?
A: Yes, with your backup. Keep it for at least a week.
Q: Do I have to update immediately?
A: No, v1.7.x still works. But v1.9.0 has major improvements.
Q: Will my custom skills migrate?
A: Yes, all skills (built-in and custom) migrate automatically.
Q: What if I have a very large database?
A: Test in development first. Migration handles thousands of players fine.
Q: Can I migrate incrementally?
A: No, it's all-or-nothing. But the process is automated and safe.
Next Steps
After successful migration:
Explore New Features
- Try Global Multipliers
- Check Performance Improvements
- Review New API
Update Documentation
- Update your server documentation
- Inform players of any changes
- Share new features with your community
Optimize
- Monitor performance metrics
- Tune configuration as needed
- Consider new use cases for global multipliers
Congratulations on upgrading to v1.9.0! 🎉
Enjoy the improved performance and new features!