PHPackages                             buchin/laravel-cloud-migrator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. buchin/laravel-cloud-migrator

ActiveProject[Database &amp; ORM](/categories/database)

buchin/laravel-cloud-migrator
=============================

CLI tool for migrating Laravel Cloud applications between organizations.

v1.3.0(1mo ago)00MITPHPPHP ^8.2CI failing

Since Apr 16Pushed 1mo agoCompare

[ Source](https://github.com/buchin/laravel-cloud-migrator)[ Packagist](https://packagist.org/packages/buchin/laravel-cloud-migrator)[ Docs](https://github.com/buchin/laravel-cloud-migrator)[ RSS](/packages/buchin-laravel-cloud-migrator/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (4)Versions (5)Used By (0)

Laravel Cloud Migrator
======================

[](#laravel-cloud-migrator)

A 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.

Requirements
------------

[](#requirements)

- PHP 8.2+
- Composer
- `mysqldump` and `mysql` (only required for `--migrate-db`)
- API tokens for both source and target Laravel Cloud organizations

Installation
------------

[](#installation)

### Composer (recommended)

[](#composer-recommended)

```
composer global require buchin/laravel-cloud-migrator
```

Make sure your Composer global bin directory is in your `PATH` (usually `~/.composer/vendor/bin` or `~/.config/composer/vendor/bin`):

```
export PATH="$PATH:$HOME/.composer/vendor/bin"
```

Then run from anywhere:

```
cloud-migrator app:migrate
```

### From source

[](#from-source)

```
git clone https://github.com/buchin/laravel-cloud-migrator
cd laravel-cloud-migrator
composer install
./cloud-migrator migrate
```

Getting API Tokens
------------------

[](#getting-api-tokens)

In Laravel Cloud, go to **Your Org → Settings → API Tokens** and create a token for both the source and target organizations.

---

Commands
--------

[](#commands)

### `app:migrate`

[](#appmigrate)

Migrate a single application interactively.

```
cloud-migrator app:migrate
cloud-migrator app:migrate --app=myapp --source-token=xxx --target-token=yyy
cloud-migrator app:migrate --app=myapp --source-token=xxx --target-token=yyy --dry-run
cloud-migrator app:migrate --app=myapp --source-token=xxx --target-token=yyy --yes --migrate-db --move-domains --deploy
```

**Options:**

FlagDescription`--app`App name or slug to migrate`--source-token`API token for the source org`--target-token`API token for the target org`--dry-run`Show the migration plan without making any changes`--migrate-db`Transfer database contents (routes through your machine)`--skip-data=schema`Skip data migration for a specific schema`--ignore-table=schema.table`Exclude a table from data migration`--move-domains`Move custom domains from source to target after migration`--deploy`Trigger a deployment on all environments after migration`--yes`Skip confirmation prompts**What gets migrated:** application, environments, environment variables, database clusters and schemas, cache clusters, instances, background processes, custom domains.

**What does NOT get migrated automatically:** database data (use `--migrate-db`), object storage bucket contents.

---

### `app:migrate-all`

[](#appmigrate-all)

Migrate 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.

```
cloud-migrator app:migrate-all --source-token=xxx --target-token=yyy
cloud-migrator app:migrate-all --source-token=xxx --target-token=yyy --dry-run
cloud-migrator app:migrate-all --source-token=xxx --target-token=yyy --yes --migrate-db --move-domains --deploy
```

Accepts the same flags as `migrate`. Apps already present in the target are skipped for migration but `--move-domains` still runs for them.

---

### `db:migrate`

[](#dbmigrate)

Migrate 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.

```
cloud-migrator db:migrate --source-token=xxx --target-token=yyy
cloud-migrator db:migrate --source-token=xxx --target-token=yyy --skip-data=logs
cloud-migrator db:migrate --source-token=xxx --target-token=yyy --ignore-table=app.reports
```

Uses a parallel per-table dump engine (up to 4 concurrent workers) to avoid query timeouts on large databases. Data routes through your local machine.

FlagDescription`--skip-data=schema`Skip an entire schema`--ignore-table=schema.table`Exclude a specific table`--yes`Skip confirmation prompts---

### `db:verify`

[](#dbverify)

Verify 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.

```
cloud-migrator db:verify --source-token=xxx --target-token=yyy
cloud-migrator db:verify --source-token=xxx --target-token=yyy --schema=myapp
cloud-migrator db:verify --source-token=xxx --target-token=yyy --skip-schema=logs
```

---

### `org:health`

[](#orghealth)

Check HTTP health of all environments in an organization, following redirects and reporting response time.

```
cloud-migrator org:health --target-token=yyy
cloud-migrator org:health --target-token=yyy --timeout=30
cloud-migrator org:health --target-token=yyy --expect-2xx   # exits non-zero if any env is not 2xx (CI use)
```

IconMeaning✓ green2xx↪ cyan3xx redirect🔒 yellow401 / 403⚠ yellowother 4xx✗ red5xx or unreachable---

### `org:status`

[](#orgstatus)

Compare source and target organizations side by side to verify migration progress.

```
cloud-migrator org:status --source-token=xxx --target-token=yyy
```

---

### `vanity:transfer`

[](#vanitytransfer)

Transfer a Laravel Cloud vanity domain (e.g. `myapp.laravel.cloud`) from the source app to the matching target app by renaming the app slug.

```
cloud-migrator vanity:transfer --app=myapp --source-token=xxx --target-token=yyy
```

If 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.

```
cloud-migrator vanity:transfer --app=myapp --source-token=xxx --target-token=yyy --delete-source --yes
```

> **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.

---

### `org:decommission`

[](#orgdecommission)

Delete 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.

```
cloud-migrator org:decommission --source-token=xxx --target-token=yyy
cloud-migrator org:decommission --source-token=xxx --target-token=yyy --delete-clusters --delete-caches --yes
```

FlagDescription`--delete-clusters`Also delete source database clusters`--delete-caches`Also delete source cache clusters`--yes`Skip confirmation prompts---

### `app:list`

[](#applist)

List all applications in a Laravel Cloud organization.

```
cloud-migrator app:list --token=xxx
```

---

Typical Migration Workflow
--------------------------

[](#typical-migration-workflow)

```
# 1. Preview what will be migrated (no changes made)
cloud-migrator app:migrate-all --source-token=xxx --target-token=yyy --dry-run

# 2. Migrate structure
cloud-migrator app:migrate-all --source-token=xxx --target-token=yyy --yes

# 3. Transfer database data
cloud-migrator db:migrate --source-token=xxx --target-token=yyy --yes

# 4. Verify row counts match
cloud-migrator db:verify --source-token=xxx --target-token=yyy

# 5. Move custom domains (zero-downtime — same IP as source)
cloud-migrator app:migrate-all --source-token=xxx --target-token=yyy --move-domains --yes

# 6. Health check the target
cloud-migrator org:health --target-token=yyy

# 7. Decommission the source
cloud-migrator org:decommission --source-token=xxx --target-token=yyy --yes

# 8. Transfer Laravel Cloud vanity domains (optional)
cloud-migrator vanity:transfer --app=myapp --source-token=xxx --target-token=yyy
```

---

Notes
-----

[](#notes)

**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.

**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.

**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.

**Rollback on failure.** If a migration fails mid-way, the incomplete target app is automatically deleted to leave the target org clean.

License
-------

[](#license)

MIT

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance89

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

4

Last Release

54d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a5a56c7945cd18010006a2c389215b7f08891ec437ec45c722f1f240f9133d4a?d=identicon)[buchin](/maintainers/buchin)

---

Top Contributors

[![buchin](https://avatars.githubusercontent.com/u/156540?v=4)](https://github.com/buchin "buchin (6 commits)")

---

Tags

clilaravelmigrationlaravel cloud

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/buchin-laravel-cloud-migrator/health.svg)

```
[![Health](https://phpackages.com/badges/buchin-laravel-cloud-migrator/health.svg)](https://phpackages.com/packages/buchin-laravel-cloud-migrator)
```

###  Alternatives

[dragon-code/laravel-deploy-operations

Performing any actions during the deployment process

242207.7k2](/packages/dragon-code-laravel-deploy-operations)[vitalibr/laravel5-exporter

MySQL Workbench Schema Exporter for Laravel 5.0

161.0k](/packages/vitalibr-laravel5-exporter)[codengine/laravel-custom-migrations

Custom Migrations for Laravel

131.3k](/packages/codengine-laravel-custom-migrations)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
