---
title: luna import
description: Create lunas in an environment from an archive that luna export wrote.
related:
  - /develop/export-and-import
  - /cli/export
---

`luna import` reads an archive that `luna export` wrote and creates its lunas in an environment.

```bash
luna import backup.tar.zst --env staging
```

## Reference

```bash
luna import [OPTIONS] <ARCHIVE>
```

| Option | Type | Default | Does |
| --- | --- | --- | --- |
| `<ARCHIVE>` | path | Required | The archive to read, from [`luna export`](/cli/export). |
| `--schedules` | flag | Off | Keeps the lunas' schedules. Without it, they start with none. |
| `--dir <DIR>` | path | `.` | The app's folder. Its env file names the project and environment. |
| `--env <ENV>` | text | `LUNA_ENV`, then `production` | The environment to create the lunas in. |
| `--project <PROJECT>` | text | `LUNA_PROJECT` | The project, by name or as `organisation/project`. |
| `--tenant <TENANT>` | text | The environment's own | A tenant added to the environment, by name. |
| `--token <TOKEN>` | text | `LUNA_TOKEN`, then your login | An API token or account key to act with. |

## Good to know

- The CLI refuses a file that does not start with `luna-export.json`, and an archive in a format this version does not read.
- Each luna comes back with its key, its SQLite database and its files.
- Importing needs `data:write` on the environment.
- The CLI prints how many lunas it imported once it is done.

## Examples

### Import an export into staging

```bash
luna import production.tar.zst --env staging
```

### Import with the lunas' schedules

```bash
luna import production.tar.zst --env staging --schedules
```
