Skip to main content

πŸ’Ύ Database Export Command – LiteEco

LiteEco includes a robust database export and migration system, allowing administrators to easily back up, migrate, or convert economy data between storage formats.


🧩 Command Overview​

/eco database export <argument> [currency]

➀ Description​

This command exports player balance data for a specified currency into different file formats or directly migrates them between databases.

The exported files are saved in the /migration/ directory, with filenames that include the currency name and a timestamp for easy tracking.


βš™οΈ Arguments​

ArgumentDescription
SQLExports all data for the selected currency into an .sql file. Useful for importing into MySQL or MariaDB databases.
CSVExports all data into a .csv file readable by spreadsheet tools like Excel or Google Sheets. Ideal for manual review and backup.
LEGACY_TABLEMigrates data directly into a connected MySQL or MariaDB database. No file is created; this is a direct import for legacy systems.
SQL_LITE_FILEExports all data into a .db file compatible with SQLite. Useful for converting from MySQL/MariaDB to SQLite.

πŸ—‚οΈ Output Files & Structure​

All exports are saved inside the /migration/ folder with the following naming pattern:

${fileName}_${currency}_${timestamp}

➀ File Naming Details​

Export TypeFile ExampleNotes
CSVeconomy_migration_dollars_20251012_153000.csvExported as comma-separated values.
SQLeconomy_migration_dollars_20251012_153000.sqlContains SQL statements for database import.
LEGACY_TABLENo file generatedData is imported directly into your connected MySQL/MariaDB instance.
SQL_LITE_FILEeconomy_migration_sql_lite_dollars_20251012_153000.sqlSQL file special for standalone SQLite file named database.db.

πŸ’‘ Usage Examples​

Export current balances of the dollars currency to a CSV file:

/eco database export CSV dollars

Export the same data as an SQL file:

/eco database export SQL dollars

Migrate legacy data directly into your MySQL/MariaDB database:

/eco database export LEGACY_TABLE dollars

Export all balances to a SQLite .db file:

/eco database export SQL_LITE_FILE dollars

🧠 Notes & Recommendations​

  • The /migration/ folder is created automatically if it doesn’t exist.
  • Timestamps follow the format yyyyMMdd_HHmmss (e.g., 20251012_153000).
  • Ensure your server has permission to write to the /migration/ folder.
  • LEGACY_TABLE mode is only available for MySQL or MariaDB connections.
  • SQL_LITE_FILE is perfect for migrating data from MySQL/MariaDB to a lightweight SQLite database (e.g., database.db).
  • For large databases, exports may take several seconds depending on server performance.

βœ… Quick Summary​

Export TypeOutputBest Use Case
CSV.csv fileManual inspection or simple backups
SQL.sql fileReimport into MySQL/MariaDB
LEGACY_TABLEDirect importLegacy MySQL/MariaDB migration
SQL_LITE_FILE.sql fileConversion to SQLite

This command provides flexibility and safety for administrators handling economy data across multiple platforms or server environments.