Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve migration #119

Merged
merged 1 commit into from Feb 24, 2017

Conversation

Projects
None yet
4 participants
@PatelUtkarsh
Copy link
Collaborator

commented Feb 24, 2017

change wp_update_post to update via $wpdb to skip extra hooks,
change ajax limit to 5 to avoid large snapshot migration timeouts,
improve migration verbosity.

Improve migration,
change wp_update_post to update via $wpdb to skip extra hooks,
change ajax limit to 5 to avoid large snapshot migration timeouts,
improve migration verbosity.
@coveralls

This comment has been minimized.

Copy link

commented Feb 24, 2017

Coverage Status

Coverage decreased (-0.2%) to 76.769% when pulling ecfd2a5 on improve/migration into cd5a18f on develop.

\WP_CLI::success( count( $ids ) . ' ' . __( 'posts migrated:', 'customize-snapshots' ) . ' ' . implode( ',', $ids ) );
$ids = $migrate_obj->changeset_migrate( -1, true );
\WP_CLI::success( __( 'Posts migrated:', 'customize-snapshots' ) . ' ' . implode( ',', $ids ) );
\WP_CLI::success( 'Total ' . count( $ids ) . ' ' . __( 'posts migrated.', 'customize-snapshots' ) );

This comment has been minimized.

Copy link
@valendesigns

valendesigns Feb 24, 2017

Member

Change the string to something like this:

\WP_CLI::success( sprintf( __( 'Total posts migrated: %s', 'customize-snapshots' ), count( $ids ) ) );
@@ -122,6 +123,10 @@ public function changeset_migrate( $limit = -1, $dry_run = false ) {
return $query->posts;
}
if ( $is_doing_cli ) {
\WP_CLI::log( __( 'Migrating', 'customize-snapshots' ) . ' ' . count( $query->posts ) . __( ' snapshots into changeset', 'customize-snapshots' ) );

This comment has been minimized.

Copy link
@valendesigns

valendesigns Feb 24, 2017

Member

Change to:

\WP_CLI::log( sprintf( __( 'Migrating %s Snapshots into Changeset', 'customize-snapshots' ), count( $query->posts ) ) );
$success = $this->migrate_post( $id );
if ( $is_doing_cli ) {
if ( $success ) {
\WP_CLI::success( __( 'Migrated post', 'customize-snapshots' ) . ' ' . $id . '.' );

This comment has been minimized.

Copy link
@valendesigns

valendesigns Feb 24, 2017

Member

Change to:

\WP_CLI::success( sprintf( __( 'Migrated post %s.', 'customize-snapshots' ), $id ) );
if ( $success ) {
\WP_CLI::success( __( 'Migrated post', 'customize-snapshots' ) . ' ' . $id . '.' );
} else {
\WP_CLI::error( __( ' Failed to migrate', 'customize-snapshots' ) . ' ' . $id . '.' );

This comment has been minimized.

Copy link
@valendesigns

valendesigns Feb 24, 2017

Member

Change to:

\WP_CLI::error( sprintf( __( 'Failed to migrate post %s.', 'customize-snapshots' ), $id ) );

@westonruter westonruter merged commit dbee0d5 into develop Feb 24, 2017

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@westonruter

This comment has been minimized.

Copy link
Contributor

commented Feb 24, 2017

Woops! Sorry @valendesigns. @PatelUtkarsh please follow-up with a new PR to address ☝️ feedback.

@westonruter westonruter modified the milestone: 0.6.0 Jul 6, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.