ποΈ Database Management
Hello there! Welcome to the Database management guide for Open Ticket. Here we will try to help you with managing, migrating and fixing corrupt tickets.
Managing your Open Ticket database allows you to read, modify, transfer, and back up your data and tickets. By default, Open Ticket stores all data in JSON files, but database plugins can be used for optimized performance.

DB Management
Modifying, fixing & transfering databases
π Database Structureβ
By default, Open Ticket stores all data inside the ./database/
folder, divided into five JSON files:
global.json
β Stores global variables, including the last Open Ticket version used, IDs of auto-updating panels, and other general data.tickets.json
β Stores all ticket-related data, including creation time, participant IDs, ticket status and plugin data.users.json
β Currently not used but reserved for plugins to store custom user data.stats.json
β Holds global, user, and ticket statistics (e.g., total tickets created).options.json
β Keeps a backup of all ticket options used from theoptions.json
config. If an option is missing from the config, it retrieves it from here.
βοΈ Manually Editing The Databaseβ
Since Open Ticket stores data in raw JSON files, you can open and edit them using any text editor (VS Code, Notepad++, etc).
π JSON File Structureβ
All data in Open Ticket is structured as an array of objects using a "category"
, "key"
, and "value"
:
[ {"category": "openticket:variable-type", "key": "user/message/ticket id", "value":null} ]
category
β Defines what type of variable is stored (e.g.openticket:ticket
).key
β The unique identifier, such as a user ID, message ID, or ticket ID.value
β The stored data (could be astring
,number
,boolean
,object
,array
ornull
).
- Never modify the database structure (keep the
category
,key
, andvalue
format). - Back up your files before making any manual changes.
- Stop the bot before editing the database to prevent corruption.
π Transferring Your Databaseβ
All database-related plugins will contain a built-in feature to migrate the JSON database to its own system.
If you want to transfer your database to a new Open Ticket version, see the guide below:
β¬οΈ Updating Open Ticketβ
Follow these steps when you want to update Open Ticket:
- Copy the
./database/
,./config/
&./plugins/
folders to another separate location. - Update the bot by downloading a new version from Github.
- Install all required npm dependencies and make sure the bot is able to start.
- Paste back the original
./database/
,./config/
&./plugins/
folders in the new bot.
π οΈ Using Database Pluginsβ
Open Ticket supports database plugins to replace JSON storage with SQLite, Redis, MongoDB or other options. (some plugins do not exist yet)
π Why Use Database Plugins?*β
β
Improved Performance β Faster queries compared to reading JSON files.
β
Better Scalability β Required for large servers with thousands of tickets.
β
Reduced Corruption Risk β Unlike JSON, databases handle concurrent writes properly.
π‘ Best Practicesβ
- π Make Regular Backups β Copy the
./database/
folder or export your database plugin data. - β‘ Use a Database Plugin for Large Servers β JSON storage is fine for small servers, but SQLite is better for large-scale use.
- π§ Avoid Manual Editing If Possible β Use plugins or Open Ticketβs built-in commands to modify data safely.
π Summaryβ
Now you know:
β
Which databases exist in Open Ticket.
β
How to properly edit the database.
β
How to optimize the database for large servers.
Don't forget to give Open Ticket a star on GitHub to help us grow!