Support » Plugin: Wordfence Security » Restoring DB from live site to localhost returns error #1062 – Duplicate entry

  • Resolved sixfootjames


    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.

Viewing 5 replies - 1 through 5 (of 5 total)
  • 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.


    Here is a comparison between the two tables

    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.

    Plugin Author Wordfence



    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

    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.


    Plugin Author Wordfence


    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.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Restoring DB from live site to localhost returns error #1062 – Duplicate entry’ is closed to new replies.