# File Import / Export

Exporting an experiment as a JSON file lets you share its design across Steadybit platforms — for example to move an experiment between on-prem instances, archive it in version control, or hand it off out-of-band.

Use this when sharing must cross a Steadybit platform boundary, or when the experiment design should live alongside other artifacts in your repository.

## How Sharing Works

Two artifacts are involved:

* **Exported JSON file** — a snapshot of the experiment's design at the moment of export, including team and environment references.
* **Imported Experiment** — a new experiment created from the file in the importing platform. Once imported, it is a regular, fully editable experiment with no link back to the original.

Because the file is a snapshot, file import/export creates a **detached copy** rather than a live link.

## Single Source of Truth

| Aspect              | Source of truth                                     |
| ------------------- | --------------------------------------------------- |
| Experiment instance | Per import — each import creates its own experiment |
| Experiment design   | Detached copy at the time of export                 |
| Experiment runs     | Per imported experiment                             |

There is no propagation of design changes after import. To apply updates, re-export and re-import — or use [Service Provided Experiments](/use-steadybit/experiments/share/service-provided.md) for a single source of truth that propagates.

## Export an Experiment

Open the experiment in the designer and click ![Export Button](/files/pBCHJcTZ1FrsfSCpxoxK) **View Experiment as JSON**.

![Experiment Editor Export](/files/YVL21TeNskK9z1shJtvY)

A popup appears with a download button and the option to copy the JSON to your clipboard. From there, you can edit it in the JSON editor of your choice.

![Download JSON](/files/GZKHhEvS7yKRiM2LQ48e)

## Import an Experiment

Click **New Experiment** in the experiment list and drop a JSON file onto the upload area (or click to pick one). The file is parsed, imported, and the resulting experiment is opened in the designer.

![New Experiment](/files/I2kmBG31fVHyTJdfME5I)

## Flexible Team and Environment Assignment

The exporting team and environment are written into the file. On import, the same team and environment must exist and be accessible to you. Otherwise, you have to change the team and environment in the import-flow.

To make exported experiments portable from beginning on, replace the concrete values with variables before export:

* `{{teamKey}}` — applies the experiment to the importing user's current team
* `{{environmentName}}` — applies the experiment to that team's first environment

## When to Use This Approach

File import/export is the right choice when:

* You need to share a design across Steadybit platform instances (e.g. between on-prem tenants)
* You want to keep experiment definitions in version control alongside other code
* You plan to use the API to automate experiment creation e.g. in CI/CD
* Each receiving environment should own a fully editable, independent copy

For other sharing needs, see the [overview of sharing options](/use-steadybit/experiments/share.md).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.steadybit.com/use-steadybit/experiments/share/file-import-export.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
