• Resolved percepts

    (@percepts)


    I used the wp backup plugin and tried to create a copy of my web database locally on my machine.

    Problem is that I found two post ids which had duplicate records in the posts table. Its only a small table as its just been created.

    So question is: Should there be duplicate records in the posts table as ID is the primary key and if not then how did they get there?
    I haven’t tweaked anything relating to db updates.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi,

    I prefer to take the backup manually. For that refer this article:

    http://codex.ww.wp.xz.cn/WordPress_Backups#Database_Backup_Instructions

    Also use this plugin to remove duplicate posts:

    http://ww.wp.xz.cn/extend/plugins/delete-duplicate-posts/

    Thanks,

    Shane G.

    Before you restored your database to your local machine, did you drop the WordPress tables such as wp_posts etc?

    Thread Starter percepts

    (@percepts)

    the backup sql has table drops in it. But the first time it failed I thought there may be some cross table referential integrity so I did a manual drop of all tables then ran the import from the sql and it failed with same duplicate error on posts. So I deleted dup recs from backup sql and ran and it worked. But when I went to look at blog it was totally screwed.
    So then I ran import of backup from local system which restored to how it was.

    Then resorted to using tools/export of xml posts file. Manually deleted posts from local blog and imported xml posts which seems to hve worked OK.
    But how come I have dup records in SQL backup? This should not happen or am I wrong about that?

    Thread Starter percepts

    (@percepts)

    just to follow up. I dumped the database using phpMyAdmin and loaded that in local setup and it has worked fine.

    Also checked that dumped data and there are no duplcayes in it.

    So I don’t why I got them before. It should not be possible to have duplicate primary keys. Could be something to do with the WP Backup plugin but I really don’t know.

    That delete duplicate post plugin is dangerously mis-leading. Attachments are entered in posts table. So a post and attachment can have the same title quite validly. And in fact that is the case for me but I don’t want those duplicate title records deleting because they are valid. It needs to look for duplicate post table ID which is a corruption of the table.

    Anyhow problem is resolved. I will use phpMyAdmin for table dumps.

    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘backup and restore’ is closed to new replies.