Commit Graph
5 Commits
Author SHA1 Message Date
Asish Kumar a41b32420a feat(export): back up split expenses
Export and restore left split events out, so moving to a new instance or
restoring a backup lost every event, its people, expenses, payments and
the links to the members' own transactions.

- Export has a "Split Expenses" option, on by default. It writes
  split_events, split_participants, split_expenses, split_expense_shares
  and split_payments. Like the bank sync option, it warns that the file
  carries something sensitive: the events' share links, kept so the links
  people already have keep working after a restore.
- split_transaction_links goes along only when transactions are exported
  too, the same way sub-transactions follow their parents, so a restore
  never points at transactions missing from the backup.
- Restore reads the new files after users, currencies and transactions,
  in dependency order. Everything is matched by id, except the event's
  currency (by name, like DCA strategies) and the linked transaction,
  which is looked up across every user: restore runs as the admin, who
  can't see the other members' transactions.
- Guests' usernames and password hashes are restored, so they can still
  sign in through the share link.
- Attachments stay out, as transaction attachments do: they're files,
  not rows.
2026-12-05 05:46:57 +05:30
Herculino Trotta 5ea7f79f56 fix(export): keep each user's names on restore and speed up big exports
Restore looked categories, tags and entities up through the admin's
filtered manager, so other users' transactions moved to the admin's
categories and lost their tags. They are now matched to the row's
owner (then to ones that owner can see) and created for that owner.
Export also read tags and entities through that manager and left other
users' private ones out.

Recurring transactions and installment plans now export account_owner,
which restore already read but never received.

Transaction exports ran a few queries per row and paged prefetched rows
with OFFSET, so large histories timed out. They now load relations up
front and read in cursor chunks: 200k transactions export in ~43s with
~200 queries (10k took 34s and ~21k queries before).

Fixes #691
Fixes #692
2026-11-17 13:01:25 -03:00
Herculino Trotta 3dcc2316fb feat(export): back up sub-transactions and quick transactions 2026-11-14 02:13:21 -03:00
Herculino Trotta 494937870e fix(export): back up asset classes and investment income links
Restore asset classes before accounts and take a second pass over accounts
once categories, tags and entities exist, so their links survive a restore
into a fresh install.
2026-11-08 02:26:40 -03:00
Herculino Trotta 3080df9b66 feat: export (WIP) 2025-02-18 19:55:12 -03:00