A Paper 1.21.8 plugin that automatically exports Essentials userdata to MySQL/MariaDB database with configurable intervals.
## Features
- **Automatic Export**: Scans Essentials userdata YAML files and exports to MySQL/MariaDB
- **Configurable Schedule**: Set custom export intervals or disable automatic exports
- **Manual Export**: Use `/userdataexport` command for on-demand exports
- **Debug Mode**: Detailed logging for troubleshooting
- **Database Integration**: Uses HikariCP for efficient database connections
- **Folia Support**: Compatible with Folia servers
## What it does
This plugin reads Essentials userdata files (typically located in `plugins/Essentials/userdata/`) and exports the following data to your MySQL/MariaDB database:
- **UUID**: Player's unique identifier (from filename)
- **Username**: Player's last account name (`last-account-name` field)
- **Money**: Player's balance (`money` field)
- **Updated timestamp**: When the record was last updated
## Installation
1. Download the plugin JAR file
2. Place it in your server's `plugins/` folder
3. Start your server to generate the configuration file
4. Configure your database settings in `plugins/UserdataExporter/config.yml`
5. Restart your server
- **Server**: Paper 1.21.8+ (Folia supported)
- **Database**: MySQL 5.7+ or MariaDB 10.2+
- **Dependencies**: Essentials plugin (for userdata files)
## How it works
1. **Startup**: Plugin connects to your database and creates the table if it doesn't exist
2. **Initial Export**: Runs an automatic export on startup
3. **Scheduled Exports**: If `exportIntervalSeconds > 0`, runs periodic exports
4. **File Scanning**: Scans all `.yml` and `.yaml` files in the userdata directory
5. **Data Parsing**: Extracts UUID (from filename), username, and money from each file
6. **Database Update**: Uses UPSERT to insert or update records
## Troubleshooting
### Enable Debug Mode
Set `debug: true` in config.yml to see detailed logging:
1. **No data exported**: Check if userdata directory path is correct
2. **Database connection failed**: Verify database credentials and network access
3. **Permission denied**: Ensure database user has CREATE/INSERT/UPDATE permissions
### Manual Testing
Use `/userdataexport` command to test exports manually and see immediate results.
## Support
- **Issues**: Report bugs and issues on the plugin page
- **Configuration**: Check the debug logs for detailed information
- **Database**: Ensure your MySQL/MariaDB server is accessible and credentials are correct