Database
AdvanceMMO supports both SQLite (default) and MySQL/MariaDB databases. This guide covers database setup and management.
Database Types
SQLite (Default)
SQLite is the default database type and requires no setup:
- No installation required
- Database file stored locally
- Perfect for small to medium servers
- No external dependencies
Limitations: Not recommended for large servers or multiple servers sharing data.
MySQL/MariaDB (Recommended)
MySQL is recommended for production servers:
- Better performance
- Supports multiple servers
- Better for large player bases
- Easier backups
Requirements: MySQL or MariaDB server installed and accessible.
SQLite Setup
SQLite is used by default. No configuration needed! The database file is created at:
plugins/AdvanceMMO/database.db
Make sure to backup this file regularly.
MySQL Setup
Step 1: Create Database
Create a MySQL database for AdvanceMMO:
CREATE DATABASE advancemmo CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
Step 2: Create User (Optional)
Create a dedicated user for the plugin:
CREATE USER 'advancemmo'@'localhost' IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON advancemmo. TO 'advancemmo'@'localhost';
FLUSH PRIVILEGES;
Step 3: Configure Plugin
Edit plugins/AdvanceMMO/config.yml:
database:
type: mysql
host: localhost
port: 3306
database: advancemmo
username: advancemmo
password: your_password
Step 4: Restart Server
Restart your server. The plugin will automatically create all necessary tables.
Database Tables
AdvanceMMO creates the following tables:
player_data- Player statistics and progressplayer_classes- Class selectionsplayer_races- Race selectionsplayer_abilities- Ability levelsplayer_quests- Quest progressplayer_professions- Profession dataplayer_achievements- Achievement progressguilds- Guild informationguild_members- Guild membershipplayer_mana- Player mana dataplayer_active_skills- Active skill cooldownsskill_combos- Skill combo trackingdungeon_definitions- Dungeon type definitionsdungeon_instances- Active dungeon instancesdungeon_worlds- Dungeon world mappingsdungeon_portals- Portal locations and data
Dungeon Tables
dungeon_definitions
Stores dungeon type definitions:
id- Primary keyname- Internal dungeon namedisplay_name- Display name for playersdescription- Dungeon descriptionrequired_level- Minimum level requiredreward_xp- XP reward for completionreward_money- Money reward for completionreward_items- Comma-separated item listmax_players- Maximum players allowedtime_limit- Time limit in seconds
dungeon_instances
Stores active dungeon instances:
id- Primary keydungeon_name- Reference to dungeon definitionowner_uuid- UUID of instance ownermembers- Comma-separated list of member UUIDscreated_at- Timestamp of creationcompleted- Whether dungeon is completedcompleted_at- Timestamp of completion
dungeon_worlds
Maps players to their dungeon world instances:
id- Primary keyworld_name- Name of the dungeon worldplayer_uuid- UUID of the playerdungeon_name- Name of the dungeon typecreated_at- Timestamp of world creation
dungeon_portals
Stores portal locations and data:
id- Primary keyworld- World name where portal is locatedx,y,z- Portal coordinatestarget_world- Target world for teleportationportal_type- Type: ENTRANCE or EXITdungeon_name- Associated dungeon name
Backup and Restore
SQLite Backup
Simply copy the database file:
cp plugins/AdvanceMMO/database.db backup/database_backup_$(date +%Y%m%d).db
MySQL Backup
Use mysqldump:
mysqldump -u advancemmo -p advancemmo > backup_$(date +%Y%m%d).sql
Restore
For SQLite, replace the database file. For MySQL:
mysql -u advancemmo -p advancemmo < backup_20240101.sql
Data Migration
To migrate from SQLite to MySQL:
- Stop the server
- Backup SQLite database
- Configure MySQL in config.yml
- Start server (tables will be created)
- Use migration tools if available
Performance Tips
- Use MySQL for servers with 50+ concurrent players
- Regularly optimize MySQL tables
- Set up automatic backups
- Monitor database size and performance