{"id":26276672,"url":"https://github.com/jsabo/gremlin-migration","last_synced_at":"2025-03-14T11:19:00.345Z","repository":{"id":278228458,"uuid":"934944481","full_name":"jsabo/gremlin-migration","owner":"jsabo","description":"Migrate Gremlin Health Checks and Scenarios From One Team To Another","archived":false,"fork":false,"pushed_at":"2025-02-18T16:58:22.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-18T17:47:15.579Z","etag":null,"topics":["chaos-engineering","gremlin","gremlin-python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jsabo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-18T16:49:48.000Z","updated_at":"2025-02-18T16:58:25.000Z","dependencies_parsed_at":"2025-02-18T17:47:19.459Z","dependency_job_id":"45329584-2229-487e-a533-06a6fbc1f1a1","html_url":"https://github.com/jsabo/gremlin-migration","commit_stats":null,"previous_names":["jsabo/gremlin-migration"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsabo%2Fgremlin-migration","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsabo%2Fgremlin-migration/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsabo%2Fgremlin-migration/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsabo%2Fgremlin-migration/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jsabo","download_url":"https://codeload.github.com/jsabo/gremlin-migration/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243565368,"owners_count":20311705,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chaos-engineering","gremlin","gremlin-python"],"created_at":"2025-03-14T11:18:59.841Z","updated_at":"2025-03-14T11:19:00.329Z","avatar_url":"https://github.com/jsabo.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gremlin Migration Tool\n\nThis tool replicates health checks, external-integrations, and scenarios between Gremlin teams. It can be used to migrate or backup configuration from one (or more) source team(s) to a destination team on the Gremlin platform.\n\n## Features\n\n- **Migrate Health Checks:** Copy health checks from one or more source teams to a destination team.\n- **Migrate Scenarios:** Replicate scenarios, updating any referenced health check IDs.\n- **External Integrations:** Copy external integrations from the source team to the destination team.\n- **Optional Cleanup:** Delete existing health checks and scenarios in the destination team before migration.\n\n## Prerequisites\n\n- Python 3.6 or higher.\n- Valid API keys for both the source and destination Gremlin accounts.\n\n## Installation\n\n1. **Clone the repository:**\n\n   ```bash\n   git clone https://github.com/yourusername/gremlin-migration.git\n   cd gremlin-migration\n   ```\n\n2. **Create and activate a virtual environment:**\n\n   ```bash\n   python3 -m venv venv\n   source venv/bin/activate  # On Windows: venv\\Scripts\\activate\n   ```\n\n3. **Install dependencies:**\n\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n## Usage\n\nThe script can be run directly via the command line. You can supply API keys either via command-line arguments or through environment variables:\n\n- `GREMLIN_SOURCE_API_KEY` for the source API key.\n- `GREMLIN_DEST_API_KEY` for the destination API key.\n\n### Command-line Arguments\n\n```bash\npython migrate.py \\\n    --source-team-ids \u003csource_team_id1\u003e \u003csource_team_id2\u003e ... \\\n    --target-team-id \u003cdestination_team_id\u003e \\\n    [--source-api-key \u003csource_api_key\u003e] \\\n    [--dest-api-key \u003cdestination_api_key\u003e] \\\n    [--delete-health-checks] \\\n    [--delete-scenarios]\n```\n\nFor example:\n\n```bash\npython migrate.py \\\n    --source-team-ids f379c5b5-6736-46a7-b9c5-b56736e6a7fb \\\n    --target-team-id d531169c-4458-4b47-b116-9c44580b471a \\\n    --delete-health-checks \\\n    --delete-scenarios\n```\n\n### Help Message\n\nRunning the script without any arguments displays the help message:\n\n```bash\npython migrate.py -h\n```\n\nOutput:\n\n```\nusage: migrate.py [-h] [--source-api-key SOURCE_API_KEY] [--dest-api-key DEST_API_KEY]\n                  --source-team-ids SOURCE_TEAM_IDS [SOURCE_TEAM_IDS ...]\n                  --target-team-id TARGET_TEAM_ID [--delete-health-checks]\n                  [--delete-scenarios]\n\nGremlin Health Checks, Integrations, and Scenarios Replicator\n\noptions:\n  -h, --help            show this help message and exit\n  --source-api-key SOURCE_API_KEY\n                        Source API key (or set GREMLIN_SOURCE_API_KEY env variable)\n  --dest-api-key DEST_API_KEY\n                        Destination API key (or set GREMLIN_DEST_API_KEY env variable)\n  --source-team-ids SOURCE_TEAM_IDS [SOURCE_TEAM_IDS ...]\n                        One or more source team IDs (space-separated)\n  --target-team-id TARGET_TEAM_ID\n                        Destination team ID\n  --delete-health-checks\n                        Delete existing health checks in destination team\n  --delete-scenarios    Delete existing scenarios in destination team\n```\n\n## Local Development\n\n1. **Clone and create a virtual environment:**\n\n   ```bash\n   git clone https://github.com/yourusername/gremlin-migration.git\n   cd gremlin-migration\n   python3 -m venv venv\n   source venv/bin/activate\n   ```\n\n2. **Install Dependencies:**\n\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n3. **Run the Migration:**\n\n   ```bash\n   python migrate.py --source-team-ids \u003csource_team_id\u003e --target-team-id \u003cdestination_team_id\u003e [--delete-health-checks] [--delete-scenarios]\n   ```\n\n## Environment Variables\n\nTo avoid entering your API keys each time, set the following environment variables in your shell or add them to your virtual environment's activation script:\n\n- On macOS/Linux:\n\n  ```bash\n  export GREMLIN_SOURCE_API_KEY=\"your_source_api_key\"\n  export GREMLIN_DEST_API_KEY=\"your_destination_api_key\"\n  ```\n\n- On Windows (Command Prompt):\n\n  ```batch\n  set GREMLIN_SOURCE_API_KEY=your_source_api_key\n  set GREMLIN_DEST_API_KEY=your_destination_api_key\n  ```\n\n## Contributing\n\nContributions are welcome! Feel free to open issues or submit pull requests.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsabo%2Fgremlin-migration","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjsabo%2Fgremlin-migration","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsabo%2Fgremlin-migration/lists"}