PHPackages                             dword-design/wp-cli-migrate-command - 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. dword-design/wp-cli-migrate-command

ActiveWp-cli-package[Database &amp; ORM](/categories/database)

dword-design/wp-cli-migrate-command
===================================

WP-CLI command to transfer a database or uploads from one connection to another.

091PHP

Since Jun 5Pushed 2y ago1 watchersCompare

[ Source](https://github.com/dword-design/wp-cli-migrate-command)[ Packagist](https://packagist.org/packages/dword-design/wp-cli-migrate-command)[ RSS](/packages/dword-design-wp-cli-migrate-command/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (2)Used By (0)

WP-CLI Migrate Command
======================

[](#wp-cli-migrate-command)

This command allows to migrate databases and upload directories across wordpress installations. URL replacements can be configured.

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

[](#installation)

Since the package index of WP-CLI is currently [on hold](https://github.com/wp-cli/wp-cli/issues/3977), the package has to be installed by hand:

```
$ cd ~/.wp-cli/packages/
$ composer require dword-design/wp-cli-migrate-command
```

Usage
-----

[](#usage)

Configure your database connections in `wp-cli.yml`:

```
databases:
  @local:
    host: localhost
    database: local_db_name
    user: local_db_user
    password: local_db_password
    domain-prefix: '//webiste.dev'

  @live:
    host: myserver.de
    database: live_db_name
    user: live_db_user
    password: live_db_password
    domain-prefix: '//www.website.de'

  ...
```

For upload migration, configure your SSH aliases in `wp-cli.yml`:

```
@live:
  ssh: user@myserver.de
  path: www
```

Note that no entry is needed for local connections. In this case, the current directory is taken.

Lastly, if the upload directories differ from `wp-content/uploads`, configure them for each SSH alias:

```
uploads:
  @local: 'some/special/dir'
  @live: 'another/special/dir'
```

If there is no corresponding SSH alias, the uploads folder is assumbed to be relative to the current directory.

Execute the `migrate` command:

```
$ wp migrate  @sourceAlias @targetAlias
```

`wp migrate db @sourceAlias @targetAlias` migrates the database from a source database to a target database. Occurrence of the domain-prefix are replaced. Beware that the database is dropped and recreated on the target system.

`wp migrate up @sourceAlias @targetAlias` migrates the `uploads` folder via rsync. Beware that files are deleted on the target system that do not exist on the source system.

`wp migrate @sourceAlias @targetAlias` executes both tasks.

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity43

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1174637?v=4)[Dword](/maintainers/Dword)[@dword](https://github.com/dword)

---

Top Contributors

[![dword-design](https://avatars.githubusercontent.com/u/13484795?v=4)](https://github.com/dword-design "dword-design (9 commits)")

### Embed Badge

![Health badge](/badges/dword-design-wp-cli-migrate-command/health.svg)

```
[![Health](https://phpackages.com/badges/dword-design-wp-cli-migrate-command/health.svg)](https://phpackages.com/packages/dword-design-wp-cli-migrate-command)
```

###  Alternatives

[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k116.5M113](/packages/jdorn-sql-formatter)[propel/propel1

Propel is an open-source Object-Relational Mapping (ORM) for PHP5.

8351.6M87](/packages/propel-propel1)[jfelder/oracledb

Oracle DB driver for Laravel

11518.4k](/packages/jfelder-oracledb)

PHPackages © 2026

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