# Importing and exporting .env files

Paste environment entries, preview a file import, and export selected secrets safely.

An `.env` file stores named values, usually one `NAME=value` entry per line. Use it to bring environment variables into Secrets or transfer selected values to another machine.

## Paste entries

1. Unlock the project's **Secrets** section.
2. Open **Import / export → Paste .env entries**.
3. Choose an environment and optional service.
4. Paste the entries and save.

The parser supports comments, optional `export`, quoted values, and multiline quoted values. Expressions remain literal; Orbit does not execute shell substitutions from an environment file.

```dotenv
# Development credentials
API_URL=https://example.com
export APP_NAME="My project"
```

Keep each intended secret in the right environment. Review validation errors rather than assuming the entire paste saved.

## Import an existing file

Choose **Import .env file** from **Import / export**, select a file, and choose an environment. The preview shows entry names without displaying their secret values. Select the names you want, then confirm the import.

Existing names in that environment are marked **Existing · skip**. The import does not silently overwrite those values. Edit an existing secret explicitly when you need to replace it. Use **Choose another file** to restart with a different source.

## Export selected values

1. Choose **Export .env file** from Secrets.
2. Choose the environment and the names to export.
3. Select a destination and review it.
4. If the file exists, confirm **Replace the existing file** only when you intend to overwrite it.
5. Complete the export.

The exported file contains **plaintext secret values**. Keep it out of source control and shared folders unless that is explicitly intended. Export only the entries needed for the destination environment.

## Transfer secrets separately from projects

A [workspace archive](/guide/settings/export-import/) includes project content but excludes vault secrets and connection credentials. To move secrets to another machine, export an .env file for each project and environment you need. On the destination machine, import the workspace archive, set up the vault, and import each .env file into the matching project and environment. Reconnect provider accounts separately.

If an export preview expires or fails, start a new export and review the destination again before writing it.
