0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-21 09:21:45 +01:00
8 Events dump and rebuild
Jason Volk edited this page 2023-02-09 16:45:50 -08:00

Events Dump & Rebuild Procedure

Dumping Events To File

The entire database can be written to a single regular file. The format is a 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.

  1. events dump <path>

Bootstrapping from Events File

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.

  1. After performing an events dump, shutdown the server.

  2. Move the events/ database directory to a backup location; this allows for a new events/ 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.

  1. Start the server with the additional -bootstrap <path> program option; example:
bin/construct -bootstrap <path> <hostname>

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.

  1. Restart the server with your normal program options to resume service.