> ## Documentation Index
> Fetch the complete documentation index at: https://docs.whawit.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Backing up Opsgenie before it shuts down

> A free, open-source command that copies an entire Opsgenie account to plain JSON — configuration and the full alert history — before Atlassian deletes it on 5 April 2027

Atlassian deletes every unmigrated Opsgenie account on **5 April 2027**. The
built-in export is an iCalendar file of the next twelve months of schedules; it
does not carry routing rules, escalation repeat settings, overrides, alert and
notification policies, heartbeats, user contact methods, integrations, or a
single alert of history.

`opsgenie-export` is a command-line tool WHAWIT publishes under the MIT
license. It reads the whole account through the REST API and writes plain JSON
files to a folder on your machine. It is useful whether or not you move to
WHAWIT: the [importer](/on-call/opsgenie) recreates schedules and escalation
policies; this tool keeps everything else, including the history the importer
deliberately leaves behind.

```bash theme={null}
npx @usewhawit/opsgenie-export --api-key <account-api-key>
```

<Note>
  The tool is **read-only**. It talks to `api.opsgenie.com` (or the EU host)
  and nothing else — no sign-up, no telemetry, no upload. Nothing in Opsgenie is
  modified, and the folder never leaves your disk unless you move it.
</Note>

## What you need

<AccordionGroup>
  <Accordion title="Node.js 20 or newer">
    `npx` downloads and runs the current version; nothing is installed globally.
  </Accordion>

  <Accordion title="An Opsgenie account API key with read access">
    **Settings → API key management → Add new API key**, with **Read** and
    **Configuration Access**. A team integration key only sees alerts and fails
    with HTTP 403 on the configuration endpoints. The same key works for the
    [importer](/on-call/opsgenie).
  </Accordion>

  <Accordion title="Your region">
    Add `--region eu` for accounts on `api.eu.opsgenie.com`.
  </Accordion>
</AccordionGroup>

## What you get

```
opsgenie-export-20270105-093000Z/
  manifest.json          counts per section, warnings, what was redacted
  account.json
  users.json             every user, with contact methods and notification rules
  teams.json             every team, with members, routing rules and team roles
  schedules.json         every schedule, rotations expanded, with all overrides
  on-calls.json          who was on call in each schedule at export time
  escalations.json       rules, delays and repeat settings
  integrations.json      configuration per integration (credentials redacted by default)
  policies.json          alert and notification policies, global and per team
  maintenance.json  heartbeats.json  services.json  forwarding-rules.json  roles.json
  alerts/2026-03.ndjson  one file per month, one alert per line, oldest first
  incidents/2026-03.ndjson
  state.json             completed months, so --resume can pick up where a run stopped
```

History is walked month by month, sorted by creation time. Opsgenie refuses any
search past 20,000 results, so a month that would exceed the cap is split until
it fits. A run that stops can be continued with `--resume` and the same `--out`.

## Options

| Option                                     | What it does                                                                        |
| ------------------------------------------ | ----------------------------------------------------------------------------------- |
| `--api-key <key>`                          | Account API key. `OPSGENIE_API_KEY` in the environment works too.                   |
| `--region us\|eu`                          | API region. Default `us`.                                                           |
| `--out <dir>`                              | Output folder. Default `./opsgenie-export-<timestamp>`.                             |
| `--since <YYYY-MM-DD>`                     | Start of alert and incident history. Default: the oldest record.                    |
| `--only <a,b,c>` / `--skip <a,b,c>`        | Limit the sections.                                                                 |
| `--with-alert-notes` / `--with-alert-logs` | Fetch notes and the activity log of every alert (one extra request per alert each). |
| `--include-secrets`                        | Keep integration API keys and webhook credentials in the output.                    |
| `--resume`                                 | Skip history months already completed in `<out>/state.json`.                        |
| `--concurrency <n>`                        | Parallel per-alert detail requests, 1–10. Default 3.                                |
| `--dry-run`                                | Validate the key and print what would be exported.                                  |

Sections: `account, users, teams, schedules, on-calls, escalations, integrations,
policies, maintenance, heartbeats, services, forwarding-rules, roles, alerts,
incidents`.

```bash theme={null}
# Configuration only — a few hundred requests, a minute or two
npx @usewhawit/opsgenie-export --api-key $KEY --skip alerts,incidents

# Two years of alerts with their notes, into a folder you can resume
npx @usewhawit/opsgenie-export --api-key $KEY --only alerts --since 2025-04-01 \
  --with-alert-notes --out ./opsgenie-backup --resume
```

## What it cannot get

* **Audit logs and reports** — not exposed by the API.
* **Alert attachments** — listed as download links, not fetched.
* **Integration secrets by default** — redacted unless you pass
  `--include-secrets`. They do not transfer anyway: every integration is
  re-created and re-keyed on the destination side.
* **Anything a team integration key cannot read** — use an account key.

## How long it takes

Opsgenie throttles by request domain, and the configuration domain (users,
teams, schedules, policies) has the lowest limit. The tool keeps a floor of
120 ms between requests, retries `429` and `5xx` with exponential backoff and
honours `Retry-After`. Configuration takes roughly one request per user, team,
schedule and integration. History is 100 alerts per request; `--with-alert-notes`
and `--with-alert-logs` add one request per alert each, which is what turns a
large account into hours rather than minutes.

<Warning>
  Compare the counts in `manifest.json` with what the Opsgenie UI shows before
  you rely on the folder, and run the export again close to your cutover date:
  overrides and notification rules keep changing until the last day.
</Warning>

## Next

<CardGroup cols={2}>
  <Card title="Importing from Opsgenie" icon="file-import" href="/on-call/opsgenie">
    Recreate schedules, rotations and escalation policies in WHAWIT from the same API key.
  </Card>

  <Card title="Migrating from another tool" icon="route" href="/on-call/migrating">
    The cutover playbook: run both systems in parallel, then switch.
  </Card>
</CardGroup>
