wp-cli-migrate
Simple data migration for WordPress., (*1)
Using
Create a migration file migrations/example.php
or the directory of your choice defined in MIGRATION_DIR
, (*2)
use Isotop\Migration\Migration;
class MyClassName extends Migration {
public function up() {
update_option( 'key', 'value' );
}
public function down() {
delete_option( 'key' );
}
}
Run the migration up:, (*3)
wp migrate up
Run the migration down:, (*4)
wp migrate down
Installing
Installing this package requires WP-CLI v1.1.0 or greater. Update to the latest stable release with wp cli update
., (*5)
Once you've done so, you can install this package with:, (*6)
wp package install git@github.com:isotopsweden/wp-cli-migrate.git
License
MIT © Isotop, (*7)