{"id":50884105,"url":"https://github.com/buchin/laravel-cloud-migrator","last_synced_at":"2026-06-15T15:02:20.829Z","repository":{"id":351707058,"uuid":"1212136536","full_name":"buchin/laravel-cloud-migrator","owner":"buchin","description":"CLI tool to migrate Laravel Cloud apps between organizations","archived":false,"fork":false,"pushed_at":"2026-04-16T05:55:11.000Z","size":84,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-16T07:21:28.522Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","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/buchin.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-16T05:09:50.000Z","updated_at":"2026-04-16T05:55:11.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/buchin/laravel-cloud-migrator","commit_stats":null,"previous_names":["buchin/laravel-cloud-migrator"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/buchin/laravel-cloud-migrator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buchin%2Flaravel-cloud-migrator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buchin%2Flaravel-cloud-migrator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buchin%2Flaravel-cloud-migrator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buchin%2Flaravel-cloud-migrator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/buchin","download_url":"https://codeload.github.com/buchin/laravel-cloud-migrator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buchin%2Flaravel-cloud-migrator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34367696,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-15T02:00:07.085Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2026-06-15T15:02:20.017Z","updated_at":"2026-06-15T15:02:20.813Z","avatar_url":"https://github.com/buchin.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel Cloud Migrator\n\nA CLI tool for migrating Laravel Cloud applications from one organization to another — including environments, environment variables, database clusters, caches, instances, background processes, and custom domains.\n\n## Requirements\n\n- PHP 8.2+\n- Composer\n- `mysqldump` and `mysql` (only required for `--migrate-db`)\n- API tokens for both source and target Laravel Cloud organizations\n\n## Installation\n\n### Composer (recommended)\n\n```bash\ncomposer global require buchin/laravel-cloud-migrator\n```\n\nMake sure your Composer global bin directory is in your `PATH` (usually `~/.composer/vendor/bin` or `~/.config/composer/vendor/bin`):\n\n```bash\nexport PATH=\"$PATH:$HOME/.composer/vendor/bin\"\n```\n\nThen run from anywhere:\n\n```bash\ncloud-migrator app:migrate\n```\n\n### From source\n\n```bash\ngit clone https://github.com/buchin/laravel-cloud-migrator\ncd laravel-cloud-migrator\ncomposer install\n./cloud-migrator migrate\n```\n\n## Getting API Tokens\n\nIn Laravel Cloud, go to **Your Org → Settings → API Tokens** and create a token for both the source and target organizations.\n\n---\n\n## Commands\n\n### `app:migrate`\n\nMigrate a single application interactively.\n\n```bash\ncloud-migrator app:migrate\ncloud-migrator app:migrate --app=myapp --source-token=xxx --target-token=yyy\ncloud-migrator app:migrate --app=myapp --source-token=xxx --target-token=yyy --dry-run\ncloud-migrator app:migrate --app=myapp --source-token=xxx --target-token=yyy --yes --migrate-db --move-domains --deploy\n```\n\n**Options:**\n\n| Flag | Description |\n|------|-------------|\n| `--app` | App name or slug to migrate |\n| `--source-token` | API token for the source org |\n| `--target-token` | API token for the target org |\n| `--dry-run` | Show the migration plan without making any changes |\n| `--migrate-db` | Transfer database contents (routes through your machine) |\n| `--skip-data=schema` | Skip data migration for a specific schema |\n| `--ignore-table=schema.table` | Exclude a table from data migration |\n| `--move-domains` | Move custom domains from source to target after migration |\n| `--deploy` | Trigger a deployment on all environments after migration |\n| `--yes` | Skip confirmation prompts |\n\n**What gets migrated:** application, environments, environment variables, database clusters and schemas, cache clusters, instances, background processes, custom domains.\n\n**What does NOT get migrated automatically:** database data (use `--migrate-db`), object storage bucket contents.\n\n---\n\n### `app:migrate-all`\n\nMigrate all applications in a source organization at once. Shared database clusters and caches are deduplicated — if multiple apps use the same cluster, only one is created in the target and all apps are linked to it.\n\n```bash\ncloud-migrator app:migrate-all --source-token=xxx --target-token=yyy\ncloud-migrator app:migrate-all --source-token=xxx --target-token=yyy --dry-run\ncloud-migrator app:migrate-all --source-token=xxx --target-token=yyy --yes --migrate-db --move-domains --deploy\n```\n\nAccepts the same flags as `migrate`. Apps already present in the target are skipped for migration but `--move-domains` still runs for them.\n\n---\n\n### `db:migrate`\n\nMigrate database data for apps that were already migrated structurally. Useful when you ran `migrate-all` without `--migrate-db` and want to transfer data separately, or need to re-run data migration for specific schemas.\n\n```bash\ncloud-migrator db:migrate --source-token=xxx --target-token=yyy\ncloud-migrator db:migrate --source-token=xxx --target-token=yyy --skip-data=logs\ncloud-migrator db:migrate --source-token=xxx --target-token=yyy --ignore-table=app.reports\n```\n\nUses a parallel per-table dump engine (up to 4 concurrent workers) to avoid query timeouts on large databases. Data routes through your local machine.\n\n| Flag | Description |\n|------|-------------|\n| `--skip-data=schema` | Skip an entire schema |\n| `--ignore-table=schema.table` | Exclude a specific table |\n| `--yes` | Skip confirmation prompts |\n\n---\n\n### `db:verify`\n\nVerify migrated database contents with exact `COUNT(*)` per table. Flags missing tables, row count mismatches, and tables only present on one side. Transient tables (`jobs`, `cache`, `cache_locks`, `sessions`, `job_batches`) are marked as expected and not flagged as errors.\n\n```bash\ncloud-migrator db:verify --source-token=xxx --target-token=yyy\ncloud-migrator db:verify --source-token=xxx --target-token=yyy --schema=myapp\ncloud-migrator db:verify --source-token=xxx --target-token=yyy --skip-schema=logs\n```\n\n---\n\n### `org:health`\n\nCheck HTTP health of all environments in an organization, following redirects and reporting response time.\n\n```bash\ncloud-migrator org:health --target-token=yyy\ncloud-migrator org:health --target-token=yyy --timeout=30\ncloud-migrator org:health --target-token=yyy --expect-2xx   # exits non-zero if any env is not 2xx (CI use)\n```\n\n| Icon | Meaning |\n|------|---------|\n| ✓ green | 2xx |\n| ↪ cyan | 3xx redirect |\n| 🔒 yellow | 401 / 403 |\n| ⚠ yellow | other 4xx |\n| ✗ red | 5xx or unreachable |\n\n---\n\n### `org:status`\n\nCompare source and target organizations side by side to verify migration progress.\n\n```bash\ncloud-migrator org:status --source-token=xxx --target-token=yyy\n```\n\n---\n\n### `vanity:transfer`\n\nTransfer a Laravel Cloud vanity domain (e.g. `myapp.laravel.cloud`) from the source app to the matching target app by renaming the app slug.\n\n```bash\ncloud-migrator vanity:transfer --app=myapp --source-token=xxx --target-token=yyy\n```\n\nIf the source app is being decommissioned anyway, use `--delete-source` to delete it first, which releases the slug immediately. There will be a brief window (~5s) while the slug transfers to the target.\n\n```bash\ncloud-migrator vanity:transfer --app=myapp --source-token=xxx --target-token=yyy --delete-source --yes\n```\n\n\u003e **Note:** Laravel Cloud holds slugs for an extended period after a rename or deletion. If claiming the slug fails, the command retries automatically for up to 5 minutes. If it still fails, re-run the command later — the \"already renamed\" state is detected and the rename step is skipped.\n\n---\n\n### `org:decommission`\n\nDelete source org applications after verifying they exist in the target. Only apps confirmed present in the target by name are deleted — unmatched apps are never touched.\n\n```bash\ncloud-migrator org:decommission --source-token=xxx --target-token=yyy\ncloud-migrator org:decommission --source-token=xxx --target-token=yyy --delete-clusters --delete-caches --yes\n```\n\n| Flag | Description |\n|------|-------------|\n| `--delete-clusters` | Also delete source database clusters |\n| `--delete-caches` | Also delete source cache clusters |\n| `--yes` | Skip confirmation prompts |\n\n---\n\n### `app:list`\n\nList all applications in a Laravel Cloud organization.\n\n```bash\ncloud-migrator app:list --token=xxx\n```\n\n---\n\n## Typical Migration Workflow\n\n```bash\n# 1. Preview what will be migrated (no changes made)\ncloud-migrator app:migrate-all --source-token=xxx --target-token=yyy --dry-run\n\n# 2. Migrate structure\ncloud-migrator app:migrate-all --source-token=xxx --target-token=yyy --yes\n\n# 3. Transfer database data\ncloud-migrator db:migrate --source-token=xxx --target-token=yyy --yes\n\n# 4. Verify row counts match\ncloud-migrator db:verify --source-token=xxx --target-token=yyy\n\n# 5. Move custom domains (zero-downtime — same IP as source)\ncloud-migrator app:migrate-all --source-token=xxx --target-token=yyy --move-domains --yes\n\n# 6. Health check the target\ncloud-migrator org:health --target-token=yyy\n\n# 7. Decommission the source\ncloud-migrator org:decommission --source-token=xxx --target-token=yyy --yes\n\n# 8. Transfer Laravel Cloud vanity domains (optional)\ncloud-migrator vanity:transfer --app=myapp --source-token=xxx --target-token=yyy\n```\n\n---\n\n## Notes\n\n**Zero-downtime domain moves.** All Laravel Cloud apps share the same IP address. Moving a custom domain only updates Laravel Cloud's internal routing — no DNS change is needed and there is no downtime.\n\n**Database data routes through your machine.** `--migrate-db` runs `mysqldump` locally and imports into the target. Large databases will take time proportional to their size.\n\n**Idempotent.** Most commands can be re-run safely. Already-migrated apps are skipped, already-moved domains are detected and skipped, and partial failures can be resumed.\n\n**Rollback on failure.** If a migration fails mid-way, the incomplete target app is automatically deleted to leave the target org clean.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuchin%2Flaravel-cloud-migrator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbuchin%2Flaravel-cloud-migrator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuchin%2Flaravel-cloud-migrator/lists"}