WordPress.org

Ready to get started?Download WordPress

Forums

WP-DB-Backup
Duplicate INSERT commands for auto draft records (6 posts)

  1. Steve Miller
    Member
    Posted 3 years ago #

    Our wp_posts table contains two auto-draft records. In the SQL dump that Wp-Db-Backup produces, two insert commands are generated to include these two records into the restored database:

    INSERT INTO wp_posts VALUES (12146, 1, '2011-03-01 06:28:37', '0000-00-00 00:00:00', '', '自动草稿', '', 'auto-draft', 'open', 'open', '', '', '', '', '2011-03-01 06:28:37', '0000-00-00 00:00:00', '', 0, 'http://www.yihanyingcihui.net/?p=12146', 0, 'post', '', 0);
    INSERT INTO wp_posts VALUES (12147, 1, '2011-03-01 19:27:11', '0000-00-00 00:00:00', '', 'Auto Draft', '', 'auto-draft', 'open', 'open', '', '', '', '', '2011-03-01 19:27:11', '0000-00-00 00:00:00', '', 0, 'http://www.yihanyingcihui.net/?p=12147', 0, 'post', '', 0);

    In the SQL dump, at the end of the section to restore data contents to wp_posts, these exact two commands generated again, with the exact same post_id values. Of course, post_id is the primary key for the table, and the second attempt at inserting the same key errors out.

    The solution probably might be to filter out the auto-draft records from getting included into the SQL dump. But then will the problem pop up some other way? If I come up with a solution I'll try to post it here.

  2. Steve Miller
    Member
    Posted 3 years ago #

    Created a ticket at the WordPress Plugins Repository.

  3. Austin Matzko
    Member
    Plugin Author

    Posted 3 years ago #

    Has this happened in more than one backup file? I could imagine something like this might happen if an auto-draft were created while the backup file was being generated, but that would be rare.

  4. Steve Miller
    Member
    Posted 3 years ago #

    I duplicated the problem today. The same two records have two sets of INSERT statements. The auto-draft records have a post_date of March 1st. (See the INSERT commands above.)

    I spent most of Friday working on this, and thought I had a fix, but it was unsuccessful. It's one of the strangest problems I've seen in a while.

  5. Austin Matzko
    Member
    Plugin Author

    Posted 3 years ago #

    It's the same 2 entries in different backup files? That is strange.

    Any chance you could send me a copy of the backup to

    austin -at- pressedcode -dot- com?

  6. Steve Miller
    Member
    Posted 3 years ago #

    On its way.

    Maybe I should mention that this WordPress site is not being used as an ordinary blog. We're using it as tri-lingual dictionary. Dictionary entries are imported into posts, using a custom importer. That doesn't explain why I'm getting duplicate INSERTs, but maybe that will take away some of the mystery of the auto-draft records.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic