-
Notifications
You must be signed in to change notification settings - Fork 42
Events dump and rebuild
All events stored in the database may be written to a single regular file. The format is a Matrix-canonical JSON array of Matrix event objects. Issue the following console command to dump events; progress updates will be logged at the INFO level and should be visible by default on standard output.
👉 While it is safe to dump events during normal service, we make no guarantee for whether new events processed after the start of the dump will be included. For optimal performance and results, conduct the dump in single-user mode by employing the
-singleprogram option.
events dump <path>
Given a fresh (or non-existent) database, Construct performs an automatic "bootstrap" creating essential internal rooms and events. This "first startup" functionality can be supplanted by an array of events in a regular file instead.
🛑 The only supported use of this feature is in conjunction with an Events Dump. The bootstrap vector must contain only valid and trusted events; essential events must not be missing. Do not modify events.
-
After performing an events dump, shutdown the server.
-
Move the
events/database directory to a backup location; this allows for a newevents/database to be created in its place.
👉 The
events/database is found at/var/db/construct/<hostname>/events/by default but its exact location may vary on different systems.
❗ Do not disturb any other databases in the directory. If your installation contains other databases such as
media/ensure they remain exactly as-is.
- Start the server with the additional
-bootstrap <path>program option; example:
ircd_db_wal_enable=false bin/construct -bootstrap <path> <hostname>
❗ Setting the configuration item
ircd_db_wal_enable=falsethrough the environment optimizes the bootstrap process by disabling the database's journal (Write-Ahead-Log). The database will be inconsistent after a crash; you will have to start again at step 2. A clean shutdown of the database is essential for a properly working result.
- Restart the server with your normal program options to resume service.