# Importing and exporting CSV

**Inventory → Import CSV**, below the item list (administrators). Download the template, fill one
item per line and upload it.

## Columns

Only `name` is required. Columns can come in any order:

| Column | What it holds |
|---|---|
| `name` | The item name (required) |
| `sku` | Your own code, unique within the site you import into |
| `upc` | The manufacturer barcode, UPC-A or EAN-13 |
| `unit` | each, box, ream... |
| `unit_cost` | What you pay per unit |
| `list_price` | What you sell it for (ignored when not for resale) |
| `reorder_point` | Low-stock threshold |
| `location` | Where it lives |
| `description` | Free text |
| `quantity` | Quantity on hand |
| `for_resale` | yes / no, per item |

The file must be UTF-8, comma or semicolon separated. Common header spellings
are recognized, and any other column is ignored; the preview lists the ones
it skipped.

## Existing items

A row whose SKU already exists is skipped, or updates that item if you choose
so: blank cells leave fields as they are, and quantities of updated items
change only if you tick the box. Quantities become adjust movements in the
[ledger](/docs/stock-movements), so the import is part of each item's
history.

## Up to 1,000 rows: preview

Files up to 1,000 rows (2 MB) are checked row by row: the preview shows what
each row will do (create, update, skip or error), nothing is written until
you confirm, and a row with a problem blocks the whole file until you fix it.

## Up to 50,000 rows: background import

Bigger files, up to 50,000 rows (10 MB), are bulk imports. The upload lands
on a page that shows the file, the first rows and what will happen; press
**Start import** and it runs in the background a few hundred rows at a time
(or **Discard** to drop it). The page shows progress and refreshes itself
every 15 seconds; you can close it.

When the import finishes, whether it succeeded or stopped, you get an email
with the counts and, for every row that was left out, the line, the item and
what was wrong in plain words. Rows with a problem are skipped, not the whole
file. One bulk import runs at a time per company. If a job stops
unexpectedly, the batches already saved stay saved; upload the file again and
the rows already imported are skipped or updated as you chose.

## What an import did

Every import, large or small, is kept under **Recent imports** on the import
page. Open one to see its result and the rows it left out; *View the items
from this import* lists the items it created or updated, and an item's page
says which import added or last updated it. Every movement an import records
points back to it too.

## Exporting items

**Inventory → Export CSV**, below the item list, downloads every item at the
site you are working in (or every site you can see, in the all-sites view)
with its quantity on hand right now, archived items included. Anyone who can
see the site can export it.

The file uses the import columns above, so it goes straight back in: import
it into another site or company and the items come back with the same
details and quantities. It also carries `site`, `sobocoo_code`, `archived`,
`low_stock` and `stock_value` for reading; the import ignores those, so
archived items come back active and every item gets a new Sobocoo code.

To move orders as well, export and import them after the items: see
[Order list and purchase orders](/docs/ordering#exporting-and-importing-orders).
