# Import/Export by command line

> Learn to export, import, migrate, and backup project data using Opik's command line tools efficiently.

The export/import command-line functions enable you to:

* **Export**: Export specific traces, spans, datasets, prompts, and experiments from a project to local JSON or CSV files
* **Import**: Import data from local JSON files into a project
* **Migrate**: Move data between projects or environments, including experiments and prompts
* **Backup**: Create local backups of specific project data

## `opik export WORKSPACE TYPE NAME`

Exports specific data types from the specified workspace to local files.

**Arguments:**

* `WORKSPACE`: The workspace name to export from
* `TYPE`: The type of data to export (`dataset`, `project`, `experiment`, or `prompt`)
* `NAME`: Exact name of the item to export

**Options:**

* `--path, -p`: Directory to save exported data (default: `opik_exports`)
* `--max-results`: Maximum number of items to export per data type (default: 1000)
* `--filter`: Filter string using Opik Query Language (OQL) to narrow down the search (for projects only)
* `--force`: Re-download items even if they already exist locally
* `--format`: Format for exporting data (`json` or `csv`, default: `json`)
* `--debug`: Enable debug output to show detailed information about the export process

**Experiment-specific options:**

* `--dataset NAME`: Filter experiments by dataset name (only experiments using this dataset will be exported)
* `--max-traces INTEGER`: Maximum number of traces to export (limits total traces downloaded)

**Examples:**

```bash