# Test and production environments

> Every environment on Osyrin Cloud is either TEST or PRODUCTION, chosen when it is made and never changed. A production environment holds real people and their data, so nothing test-only ever runs there: only a test environment takes a seed or a reset of its data.

<!-- id: local-test-environments · area: local · stability: preview · html: https://osysharp.com/reference/local/test-environments/ -->

## Summary        {#summary}

An environment of your organization is **either a test environment or a production environment**. You choose which when you
make it, and it stays that way. A production environment holds real people and their data, so nothing test-only ever runs
there. A test environment is for trying the app out with demos, exams or a harness's data, and it is the only kind that
takes a **seed** or a **reset** of its data.

## Signature      {#signature}

```console
osyrin org add-environment <slug> --test | --production [--name <name>] [--offering <name>] [--rank <n>]
```

## Description    {#description}

**Choosing the kind.** `osyrin org add-environment` needs `--test` or `--production`. On a terminal you are asked if you give
neither. When nothing can ask, for example in a script, the command is refused. Admin's New environment form and Studio's
Publish sheet ask the same question and never pick an answer for you. The kind cannot be changed later. To turn a test
environment into a production one, make a new production environment instead. Every environment made before kinds existed
is production. A test environment counts toward your plan's environments like any other.

**Where the kind shows.** Admin's environments page and app page show a Test or Production badge on each environment.
`osyrin org environments` has a Kind column (`kind` in `--json`), as does `osy link --json`. `osy deploy` says which kind it
deploys to, for example "Asking for a deploy of billing to staging — a TEST environment…".

**What a test environment allows.** Admin's environments page lists each test environment's seeds and resets: the seed, who
asked for it, when, and how it went. A seed's rows stay until that same seed is loaded again or the environment is reset, and
rows your app's users wrote are never touched. Seeding or resetting a production environment is refused, however the request
is made.

**Locally it is different.** `osy seed <seed>` runs against the app on this machine and **replaces** its rows. Local data is
your scratch space.

## Examples       {#examples}

```console
osyrin org add-environment staging --test --name Staging    # a TEST environment: seeds and resets allowed
osyrin org add-environment live --production --name Live    # a PRODUCTION environment: real people and their data
osy deploy --env staging --server https://osyrin.app        # "… to staging — a TEST environment…"
osy seed demo                                               # local: replaces the local app's rows
```

## See also       {#see-also}

[Deploying your app to an environment](https://osysharp.com/reference/local/deploying-your-app/): deploy the app to an environment.

[Importing data](https://osysharp.com/reference/local/importing-data/): bring in real rows from a file rather than a seed.
