Switching from YAML (file) to MySQL (DB)
GWorld v2 features intelligent migration systems that make transitioning from older versions or switching between storage media (files to database) as easy as possible.
Looking for information on migrating from v1 to v2? Then please follow this link: [Migration from v1-legacy to v2](https://books.gilljan.de/books/gworld-dokumentation-de/page/migration-von-v1-legacy-zu-v2 “Migration from v1-legacy to v2”)
Switching from YAML to MySQL
If you no longer want to store your world data locally in a file, but centrally in a MySQL database, GWorld v2 offers an automatic transfer service.
Steps for the changeover
- Stop your server.
- Open
config.ymland setStorage.TypetoMYSQL.If
Storage.Typeis missing, please update your config.yml. See: [Standard configuration files](https://books.gilljan.de/books/gworld-dokumentation-de/page/standard-konfigurationsdateien “Standard configuration files”) - Enter your database access data in the
MySQLsection. - Restart the server.
What happens at startup?
- Data transfer: GWorld detects that MySQL is enabled, but a local
worlds.ymlfile with data still exists. - Import: The plugin reads all worlds from the file and writes them to the corresponding MySQL tables.
- Completion: To prevent duplicate imports, the local file is renamed to
worlds.yml.importedafter successful completion. - Security: If a world already exists in the database, it is not migrated for security and integrity reasons.
Security measures & requirements
To ensure a smooth migration, please note the following points:
Requirements
- Database availability: If MySQL is configured, the plugin will abort the startup process if no connection can be established to prevent data loss.
Checklist
- Ensure that the database user has permissions to create tables (
CREATE), insert (INSERT) and modify (UPDATE) data. - Before switching, create a manual backup of your entire plugin folder.
- After switching, use the
/gworldscommand to check that all worlds are listed correctly.
This documentation refers to GWorld version 2.0.0.