Import & Export
TravStats keeps your data portable on purpose — list imports to seed a fresh instance, a spreadsheet round trip for mass edits, and a Postgres-level backup when you want a complete snapshot.
The import hub
Section titled “The import hub”Settings → Import shows one tile per enabled domain. Everything here funnels through the same preview-and-commit pipeline: after picking a file you see every row with its validation badges, the questionable rows ordered first, a mapping for columns the import could not place — and only what you confirm is written.
| Tile | Source | Domain |
|---|---|---|
| From Flightradar24 | unmodified my.flightradar24.com CSV export | Flights |
| From any logbook (CSV) | any flat per-flight CSV — column-mapping wizard | Flights |
| Spreadsheet | the workbook TravStats itself exported | Supported tables — see Spreadsheet |
| Hotel list (CSV) | a flat per-stay CSV | Lodging |
| Google Maps saved places | a Google Takeout list | Places — see Places |
A switch on the hub decides whether flights sharing a booking reference silently become a trip. Switched off, the booking reference is kept so Detect trips can group them later. Auto-created trips carry the date range of their flights.
Every import is a batch, and can be taken back
Section titled “Every import is a batch, and can be taken back”Flights, cruises, stays, places and visits record where each row came from and which run created it. The import log lists every run — file name, date, what it created — and a button reverts the whole run as one batch. Email imports are logged with a file name too, so several on the same day can be told apart.
Because rows remember their source, the same document read twice adds nothing the second time, and re-importing a file ends with a report — imported, partly imported, all duplicates — rather than in silence.
Flight list imports
Section titled “Flight list imports”From Flightradar24
Section titled “From Flightradar24”Drop the unmodified CSV. The column map for FR24’s schema is built in
(it handles the leading blank line and the (IATA/ICAO) annotations).
Times are converted server-side using the airport catalogue, no UTC
maths on your side. Field mapping:
Flight reason→ category (Business →business, Leisure →vacation)Seat number,Note,Registration→ the matching flight fields- Status defaults from the departure time vs. now (past →
flown, future →scheduled)
Each row is tagged with its source so the provenance stays visible on the flight.
From any logbook (CSV)
Section titled “From any logbook (CSV)”For non-FR24 CSVs a column-mapping wizard opens automatically. Each CSV column gets a dropdown for the matching TravStats field; known header names are suggested. Same timezone maths, same preview, same commit path. A mapping that produces no readable row keeps its continue button disabled rather than promising work it will not do.
The FlightDiary comparison has a column-by-column mapping for migrating in.
Hotel list import
Section titled “Hotel list import”A flat CSV of stays. The preview names every row it considers questionable and orders those first; a chain the catalogue does not know is offered, never created behind your back; two names are offered as one house when the town agrees and they share an identifying word (“Hotel Meteora” beside “Hotel Restaurant Meteora”), and a hit is a guess you confirm, never a silent merge. Houses without coordinates are geocoded afterwards in the background, so a slow lookup never blocks the import. See Lodging.
Programmatic import: POST /api/v1/import/parse
Section titled “Programmatic import: POST /api/v1/import/parse”Scripts can run the FR24 / generic-CSV parser → preview flow over the
API without reimplementing the column map. Authenticate with a
Personal Access Token — a
read-scope token is enough, because the parser writes nothing.
curl -X POST https://travstats.example.com/api/v1/import/parse \ -H "Authorization: Bearer ts_pat_…" \ -H "Content-Type: application/json" \ -d '{"source":"fr24","csv":"<csv contents>"}'Returns the same preview rows the browser shows. Commit them through
POST /flights/batch (write scope). The request and response shapes
are in the OpenAPI spec.
Spreadsheet round trip
Section titled “Spreadsheet round trip”Supported travel tables export to one workbook and return through Add only, Merge or Replace contents. In 2.7 the supported sheets include stays, cruise stops, roadtrips, tours, rail, coach rides and rentals as well as the original domains. See Spreadsheet for exact coverage, identity handling and the limits. Notes, photographs, documents and settings are not preserved by treating Excel as a backup.
JSON export and trip files
Section titled “JSON export and trip files”The admin Export all data action downloads a readable JSON export across the instance’s users and the included catalogue data. It is an admin export, not a personal backup button in every account. Credential material is excluded: password hashes, API tokens, pairing codes and stored API keys are not a reason to use this file as a restore archive.
The JSON is not the database restore format. To move one trip, use the
reviewable .travstats trip transfer. To edit or
move supported travel tables, use the spreadsheet pipeline.
Instance backups
Section titled “Instance backups”A built-in backup is a .tar.gz archive with the SQL database dump, an upload
archive and metadata. It includes document originals and note photos as well
as other registered upload directories. The instance’s encryption material
is not in the archive and must be preserved separately.
Automatic backups are off until enabled. The default interval is weekly; retention is measured in days. There is no free-form cron field in the admin schedule. Optional WebDAV provides an off-host copy.
Use Backups and restore for the complete procedure,
including the distinction between a built-in archive and a manual pg_dump.
A database dump alone contains neither uploaded files nor /app/data/secrets/.
Moving to another host
Section titled “Moving to another host”Keep a matching image version, database, upload files and encryption material. The built-in restore preserves the destination instance’s own URLs and WebAuthn identity, resets phone sync history and removes public share links. Check those settings after the move rather than expecting the source hostname to become the destination’s hostname.
For an older archive, the built-in restore checks migration compatibility. Do not downgrade a migrated database by changing only the image tag. Rehearse the restore on an isolated instance before relying on the archive.