# Spreadsheet import

Settings, then Backup & Restore, accepts one CSV at a time. Choose risks, controls, assets, or policies, map the columns, and read the preview before anything is written. The preview is a dry run. Import then writes the valid rows for that file in one database transaction. Rows with errors are left out. If the write itself fails, the whole file is rolled back.

Templates with fictional sample rows are in `docs/import-templates/`. Copy a template, replace the rows, and save as CSV. The samples use `example.test` addresses and do not describe a real organisation. Control rows name a code such as `A.5.1` only. Do not paste control catalogue text into the sheet.

## Before you start

- Risks, assets, and policies are matched by the exact title or name, after trimming spaces. The same title updates the existing row instead of adding another. Matching is case-sensitive.
- Controls are matched to a code that is already in the control catalogue (`A.5.1`, `NIS2-ART21-1`, and so on). The framework column is optional until that code exists in more than one catalogue. An unknown code is an error. The import never creates catalogue rows.
- A blank cell does not clear a value already stored.
- At most 5,000 data rows per file.

## Dates

Use `YYYY-MM-DD` or `DD/MM/YYYY`. The second form is day-first: `03/04/2026` is 3 April 2026, not 4 March. A time on an ISO date is ignored, so `2026-04-03T23:30:00Z` stays 3 April. Anything else, including `03/15/2026` (there is no month 15), is a row error.

## Likelihood and impact

Use an integer from 1 to 5, or one of these words (the same list for both columns):

| Score | Accepted words |
| --- | --- |
| 1 | very low, rare, negligible, insignificant |
| 2 | low, unlikely, minor |
| 3 | medium, moderate, possible |
| 4 | high, likely, major |
| 5 | very high, almost certain, severe, critical, extreme, catastrophic |

`Low`, `Medium`, and `High` are 2, 3, and 4. Other words are rejected. Both scores are needed before the inherent score is stored.

Risk status is `draft`, `approved`, `reviewed`, `treated`, or `accepted`. The description is stored as the scenario text on the risk assessment.

## Owners

If the cell is a workspace member's email, or already their display name:

- Risks, controls, and assets store the display name, or the email when the member has no name.
- Policies store the member's email.

Any other owner is stored as typed, and that row gets a warning.

## Controls

Status is `not_implemented`, `in_progress`, `implemented`, or `not_applicable` (`N/A` is accepted for the last one). `implemented` needs an evidence location on the row, an evidence location already saved, or an evidence record that is not rejected. Without that, the row is still saved and the status is set to `in_progress`, with a warning. `not_applicable` needs a justification.

## Assets and policies

A new asset needs a name, a type, and a category. Policy status is `draft`, `review`, `approved`, or `archived`. Policy review dates use the same date rules, including when a policy is edited in the app.

## What this import does not do

It does not read Excel workbooks, link risks to controls, or build a gap report. Enable the framework catalogue before importing control codes.

## A first migration of this size

For about three sheets, 50 risks, 100 controls, and 100 assets, plan on roughly a working day (about 8 hours) the first time: a few hours to reshape the sheets and dates, an hour or two to line control codes up with the catalogue, then a dry run, the fixes it lists, and a spot check in the register. A sheet that already uses these columns and codes is closer to half a day.
