Skip to content

Migrating from corten matrix 1.3.x

Grayson Adams edited this page Nov 26, 2026 · 1 revision

An existing corten-matrix 1.3.x login and database can be used by macoun-matrix without logging in again, provided the login's hardware key came from the Mac that will run the relay. macoun keeps the upstream database owner name, state directory name and file formats for this reason.

Work on a copy first.

Steps

  1. Set up the relay on the Mac (Setup, steps 1 and 2) and check /health from the bridge host.
  2. Stop the old bridge.
  3. Copy the database (with any -wal and -shm files) and the whole corten-matrix/ state directory. keystore.plist must come along: without it the bridge clears the login.
  4. Back up corten-matrix/anisette/state.plist separately. macoun does not use it; keeping it makes a rollback clean.
  5. Do not re-extract or edit the hardware key. Point the bridge at the relay with MACOUN_NAC_RELAY_URL, MACOUN_NAC_RELAY_TOKEN and MACOUN_NAC_RELAY_CERT_FP.
  6. Start macoun-matrix on the copy with the same config.yaml. Have the relay up before this first start: if the stored registration needs refreshing, the bridge registers at once.
  7. Check the log for macoun-matrix starting and Hardware key: validation data from NAC relay. If the second line is missing, the relay settings were not picked up.

What to expect

  • Apple sees the Mac's own anisette identity at the next Apple ID token refresh. A 2FA prompt, or iCloud features asking for a new login, are possible. Messaging does not depend on it.
  • The first start reads the CloudKit attachment zone and the recycle bin in full once, to build the local index and copy. On an account with a long history this start takes longer than later ones.
  • Each iMessage group room receives one power-level event, which lets you invite and remove contacts in it (see Groups).

What macoun adds to the data

  • Tables: macoun_outbound_limiter, macoun_attachment_index, macoun_attachment_index_state, macoun_recycle_bin_record, macoun_recycle_bin_zone.
  • Key files in the state directory: macoun-limiter.key, macoun-attachment-index.key.
  • Rows named macoun_rehydrate_empty:<portal> and macoun_local_delete:<portal> in the existing cloud_maintenance table.

Existing tables and files are not changed in format.

Rolling back

Stop macoun-matrix and start the old bridge on the data you kept from step 3. If you ran macoun on the original data instead of a copy, the additions listed above are not used by corten-matrix 1.3.x, so the old bridge can be started on it as well; restore anisette/state.plist from the backup first.

If the hardware key came from a different Mac

Then the relay's Mac and the registered identity do not match. Log out, extract a key on the relay's Mac and log in again.

Clone this wiki locally