> For the complete documentation index, see [llms.txt](https://docs.bugbug.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bugbug.io/export-import-and-backup/exporting.md).

# Exporting

### Export a single test

1. Open the test.
2. Open the **Actions menu** in the top right.
3. Choose **Export**.
4. Pick a format and confirm.

The export modal offers two formats:

<figure><img src="/files/sT3Aw8cGgbmGqmD1NUfi" alt="Export test modal with the YAML and ZIP options"><figcaption></figcaption></figure>

| Format                  | Contains                                                                       |
| ----------------------- | ------------------------------------------------------------------------------ |
| **YAML**                | The test alone. Components and any files it uses are referenced, not included. |
| **ZIP with components** | The test, every reusable component it uses, and the files those steps need.    |

Choose YAML when the destination project already has the required components or when you want a file that is easy to review. Choose ZIP when the destination may not have those components or files.

***

### Export a whole project

A project export is always a ZIP. It contains the tests, components, suites, profiles, project settings, folder structure, and uploaded files.

You can start it from two places:

* **Project settings → Export → Download .zip**
* The **Actions menu** on a project card in your project list → **Export**

***

### Export through the API

The [Public API](/integrations/public-api.md) returns both exports from `GET` endpoints. Authenticate with your project API token:

```bash
curl -L \
  -H "Authorization: Token <api-token>" \
  "https://api.bugbug.io/v2/tests/<test-id>/export/yaml/" \
  -o test.bugbug.yaml
```

Replace `yaml` with `zip` to include the test's components. To export the whole project, call `/v2/project/export/`. The API token identifies the project, so that endpoint needs no project ID.

See the **Import & export** section of the [API reference](https://app.bugbug.io/docs/swagger/?version=v2) for the request and response definitions.

***

### File names

Downloads use the slug of the exported item:

| Export         | File name                 |
| -------------- | ------------------------- |
| Test as YAML   | `test_<slug>.bugbug.yaml` |
| Test as ZIP    | `test_<slug>.zip`         |
| Project as ZIP | `project_<slug>.zip`      |

***

### What an export does not include

An export contains **definitions**, not run results. It does not include:

* run history
* screenshots and DOM snapshots captured during runs
* console and network logs

Visual regression baselines are included because they are part of the test definition. A ZIP export puts them in `artifacts/`, alongside files used by upload steps.

Use a project export to move or preserve the test suite. It does not archive the results of previous runs.

***

### Keeping exports in Git

Exports are plain text files, so Git can show changes to steps and selectors. Commit an export, change a test in BugBug, and export it again to see the difference:

```diff
   - action: click
     action_details:
-      selector: xpath=//BUTTON[@id="submit"]
+      selector: xpath=//BUTTON[@data-testid="submit"]
```

You can review those changes in the same pull request as the product changes that prompted them.

{% hint style="danger" %}
**Exports contain secret values in plain text.**

Exports do not mask secrets. Profile variables marked as secret are written with their real values. The same applies to values entered by `type` steps, including passwords, and to the username and password used by basic authentication steps.

Review an export for credentials before committing it to a shared repository. Treat it like a `.env` file: keep it in a private repository and do not publish it.
{% endhint %}

***

### Frequently asked questions

<details>

<summary><strong>Can I export just one component, suite, or profile?</strong></summary>

No. Export the project to get all of them, or export a test as ZIP to get the components it uses.

</details>

<details>

<summary><strong>Can I export from the CLI?</strong> </summary>

Not yet. The current CLI runs tests; it does not move files. Use the API in the meantime.

</details>

<details>

<summary><strong>Does exporting change anything in my project?</strong> </summary>

No. Export is read-only.

</details>

<details>

<summary><strong>Can I export several tests at once without exporting the whole project?</strong> </summary>

Not from the app. Export the project ZIP and take the files you need out of `tests/`.

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.bugbug.io/export-import-and-backup/exporting.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
