WordPress.org

Ready to get started?Download WordPress

Forums

WP Migrate DB
[resolved] Duplicate records in wp_posts (8 posts)

  1. vtxyzzy
    Member
    Posted 1 year ago #

    Using WP Migrate DB, version 0.4.2.

    Duplicate records were created in the export. All the duplicates were in the wp_posts table and showed up in a block near the end of the dump.

    Some legitimate records were not included in the export.

    http://wordpress.org/extend/plugins/wp-migrate-db/

  2. MarcGuay
    Member
    Posted 1 year ago #

    Having similar issues here. I have to manually pull out duplicate records before importing them to the other DB. Steps to possibly reproduce:

    1) Migrate DB from site A to site B.
    2) Add posts/content to site B.
    3) Migrate DB from site B to site A.

  3. MarcGuay
    Member
    Posted 1 year ago #

    So that I could compare my local DB more easily with the dumped data I added ORDER BY ID ASC to the MySQL statement and I no longer have any duplicates. The exact change was:

    $order = ($table == 'wp_posts') ? "ORDER BY ID ASC" : null;
    $table_data = $wpdb->get_results("SELECT * FROM $table $where $order LIMIT {$row_start}, {$row_inc} ", ARRAY_A);

    on line 603 of wp-migrate-db.php.

  4. Brad Touesnard
    Member
    Plugin Author

    Posted 1 year ago #

    Maybe one of you could send me your database and steps to reproduce so I can get to the bottom of this issue?

  5. vtxyzzy
    Member
    Posted 1 year ago #

    I no longer have the exact database that caused the problem - it has been updated quite a lot. I am unable to recreate the problem on the new database.

  6. blig
    Member
    Posted 1 year ago #

    Just had a similar issue with these options checked.

    Do not export spam comments
    Do not export post revisions

    The latest export worked without duplicates unchecking the options above, Maybe it could help.

  7. Tim Hyde
    Member
    Posted 1 year ago #

    Yep same problem.

    Error occurs only when using the tow options as stated above.

  8. Brad Touesnard
    Member
    Plugin Author

    Posted 1 year ago #

    I've implemented MarcGuay's fix in the latest version (0.4.4) released this week. Thanks Marc!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic