Wordfence Security
[resolved] Restoring DB from live site to localhost returns error #1062 - Duplicate entry (6 posts)

  1. sixfootjames
    Posted 2 years ago #

    I'm trying to restore a working online DB to my localhost machine which I have done a thousand times in the past without problems but on Friday, I landed up with the following error.

    SQL query:

    -- -- Dumping data for table wp_wfConfig -- INSERT INTO wp_wfConfig (name, val) VALUES ('actUpdateInterval', 0x32), ('alertEmails', 0x7765626d6173746572406172797374616c696665736369656e63652e636f2e7a61), ('alertOn_adminLogin', 0x31), ('alertOn_block', 0x31), ('alertOn_critical', 0x31), ('alertOn_loginLockout', 0x31), ('alertOn_lostPasswdForm', 0x31), ('alertOn_nonAdminLogin', 0x30), ('alertOn_throttle', 0x30), ('alertOn_warnings', 0x31), ('apiKey', 0x356132373234663433303764353439633335333132633639636165313462633830323137333665353961326163326537613031386162663938326465623063666262393762616466303864396235346234303464363634613861303739306339343361386432636634666536623639623066346238646662656139323365613463343431366430356162666237366264353636653064623365333362316437363331666162643462373830633462623537363831653162666435646364333734), ('autoBlockScanners', 0x30), ('blockedTime', 0x333030), ('blockFakeBots', 0x30), ('currentCronKey', ''), ('debugOn', 0x30), ('deleteTablesOnDeact', [...]

    MySQL said: Documentation

    #1062 - Duplicate entry 'actUpdateInterval' for key 'PRIMARY'

    I have already run a mysqlcheck on the tables as well as tried to manually remove the duplicate entries.

    Is there something else I am missing here?

    Thank you.


  2. sixfootjames
    Posted 2 years ago #

    I have run table repairs on all the tables but this has not solved the issue either.

    Next, I've duplicated the working online DB. Duplicated the site, logged in and deleted Wordfence in the hope that it deletes the tables for Wordfence too but this has not worked either.

    I'm now at a loss as to what to do next? Any thoughts? This is keeping me from working on the project which I need to get done.


  3. sixfootjames
    Posted 2 years ago #

    Here is a comparison between the two tables


  4. sixfootjames
    Posted 2 years ago #

    This is not the ideal solution by I eventually dropped all the wp_wf... tables and exported it again which has now worked. Messy, very messy as I don't know enough to see what other dependencies there might be but it's worked for now and I can continue on again with work. I would still like to hear a better solution to this...if for anything to help other people who come across this.

  5. Wordfence
    Plugin Author

    Posted 2 years ago #


    You can download Wordfence Assistant and it'll remove the wordfence tables for you. Alternatively you can check the box to remove Wordfence data on uninstall at the bottom of the Wordfence options page. It's in our FAQ which is at http://support.wordfence.com/

    Not sure why you got that duplicate key. We haven't modified the Wordfence schema so it's not likely that a DB will export duplicate keys and then crash on import. Feels like something else is awry there. Not pointing fingers, just not sure why you'd end up with dups in an export. Perhaps a corrupted table which you then truncated or dropped which fixed it?

    Glad to hear you got it resolved.


  6. Wordfence
    Plugin Author

    Posted 2 years ago #

    Just wanted to add that Wordfence Assistant is in the plugin repository so it can be found with a search for 'wordfence assistant' without quotes.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Wordfence Security
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic