Opsgenie Migration Tool
helps you to migrate your data from one Opsgenie account to another. It is a CLI tool that uses the Opsgenie REST API to export data from the source account and import it into the target account.
Opsgenie is a modern incident management platform for operating always-on services, empowering Dev & Ops teams to plan for service disruptions and stay in control during incidents. With over 200 deep integrations and a highly flexible rules engine, Opsgenie centralizes alerts, notifies the right people reliably, and enables them to take rapid action. Throughout the incident lifecycle, Opsgenie tracks all activity and provides actionable insights to improve productivity and drive continuous operational efficiencies.
Opsgenie is a Atlassian product. Atlassian is a leading provider of team collaboration and productivity software and the maker of Jira, Confluence, Bitbucket, and Trello products.
You can use this tool to migrate the following data:
- Teams
- Users
- Schedules
- Custom Roles
- Escalations
- Policies
- Integrations
- Rotation Schedules
- Python 3.12 or later
- An API key for the source Opsgenie account
- An API key for the target Opsgenie account
-
Clone the repository
-
Create a
.env
file in the root directory -
Add the following variables to the
.env
file# Source Opsgenie API Key SOURCE_API_KEY="" # Destination Opsgenie API Key DESTINATION_API_KEY="" # Source Opsgenie API URL BASE_URL="https://api.eu.opsgenie.com"
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
- requests
- python-dotenv
- termcolor
python main.py --color
- Slack integration can't be migrated using API
graph LR
A[Start] -- GET --> B[List all teams in source]
A -- GET --> C[List all teams in destination]
A --> D[Ask which team to migrate]
D -- Q --> T[Exit]
D --> X[Check if team exists in destination]
X -- Yes --> Y[Ask if team should be updated]
Y --> E[Get team data from source]
Y --> Z[Get team data from destination]
Z --> AA[Compare team data]
AA -- PATCH --> BB[Update team]
BB --> S[Again?]
X -- No --> E[Get team data from source]
D -- GET --> E[Get team data from source]
E --> F[Team payload]
E --> H[Schedule]
E --> G[Custom Role]
E --> I[Integrations]
E --> J[Escalations]
F -- POST --> M[Team migration]
H -- POST --> N[Schedule migration]
G -- POST --> O[Custom Role migration]
I -- POST --> P[Integration migration]
J -- POST --> Q[Escalation migration]
M --> S[Again?]
N --> S[Again?]
O --> S[Again?]
P --> S[Again?]
Q --> S[Again?]
S -- No --> T[Exit]
S -- Yes --> A[Start]