Title: Database Restore Breaks 2FA
Last modified: September 8, 2020

---

# Database Restore Breaks 2FA

 *  Resolved [agreenstreet](https://wordpress.org/support/users/agreenstreet/)
 * (@agreenstreet)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/database-restore-breaks-2fa/)
 * Hi There,
 * Can you please explain why doing a database restore via phpMyAdmin > Import breaks
   2FA?
 * The only way to recover the situation is to disable the WordFence plugin via 
   a FTP client, login without WordFence 2FA. Re-enable the WordFence plugin and
   disable 2FA for the administrator user. Then re-enable 2FA for the admin user
   account.
 * If you have more than one administrator (or other type of user) setup for 2FA
   then they too have to be disabled and re-enabled from 2FA, setting up the new
   code generator on your phone, for example Google Authenticator.
 * Why does doing a backup restore break 2FA?
 * Thanks for explaining, my issue is resolved, now I’m just trying to understand
   the reasons why the problem occurs.
 * Alastair

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

 *  Plugin Support [WFAdam](https://wordpress.org/support/users/wfadam/)
 * (@wfadam)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/database-restore-breaks-2fa/#post-13382077)
 * Hello [@agreenstreet](https://wordpress.org/support/users/agreenstreet/) and 
   thanks for reaching out.
 * What storage engine is set for these two tables after doing the import:
    wp_wfls_2fa_secrets
   wp_wfls_settings
 * My bet is that when you imported the backup, those two tables were incorrectly
   set to use MyISAM (these two tables have to be set to use InnoDB or they won’t
   function correctly – all other Wordfence tables can use either MyISAM or InnoDB).
 * Let me know if this helps!
 * Thanks!
    -  This reply was modified 5 years, 9 months ago by [WFAdam](https://wordpress.org/support/users/wfadam/).
 *  Thread Starter [agreenstreet](https://wordpress.org/support/users/agreenstreet/)
 * (@agreenstreet)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/database-restore-breaks-2fa/#post-13383434)
 * Hi [@wfadam](https://wordpress.org/support/users/wfadam/) ,
 * Thank you for the reply.
 * Looking at phpMyAdmin backend for the table types, I see all of the tables set
   to MyISAM except for the following set to InnoDB:
 * wp_options
    wp_popularpostsdata wp_popularpostssummary wp_wfls_2fa_secrets wp_wfls_settings
 * I cannot tell at this stage what the original table formats would have been prior
   to the database restore. Would the MySQL dump command not save the existing table
   formats and recreate them upon a restore without changing table types?
 * Your suggested explanation may well explain the issue.
 * Would you recommend changing all the table types over to InnoDB?
 * Thanks.
 * Alastair
    -  This reply was modified 5 years, 9 months ago by [agreenstreet](https://wordpress.org/support/users/agreenstreet/).
 *  Plugin Support [WFAdam](https://wordpress.org/support/users/wfadam/)
 * (@wfadam)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/database-restore-breaks-2fa/#post-13383687)
 * Hello again [@agreenstreet](https://wordpress.org/support/users/agreenstreet/)
 * You require a MySQL or MariaDB database. Wordfence will work with MyISAM or the
   InnoDB storage engine set as your default engine. Apart from the two tables listed
   below, we don’t specify storage engine type when creating our tables and will
   use your defaults. The two tables below will be created using the InnoDB storage
   engine:
 * wp_wfls_2fa_secrets
    wp_wfls_settings
 * If you are having issues with corrupt tables try reinstalling using InnoDB as
   the default storage engine instead of MyISAM as it tends to be a bit more stable.
 * The above is from our help documentation on system requirements.
    [https://www.wordfence.com/help/advanced/system-requirements/](https://www.wordfence.com/help/advanced/system-requirements/)
 * Those two databases NEED to be InnoDB but the others can be MyISAM. I personally
   recommend InnoDB due to better stability though.
 * Thanks again for your support!
 *  Thread Starter [agreenstreet](https://wordpress.org/support/users/agreenstreet/)
 * (@agreenstreet)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/database-restore-breaks-2fa/#post-13383704)
 * Hi [@wfadam](https://wordpress.org/support/users/wfadam/) ,
 * Sounds like some good advice re: the table structure defaults.
 * Thanks for the explanation and suggestions, please consider this closed as there
   is no definitive way for me to confirm what caused the issue.
 * Have a great day.
 * Alastair
 *  Plugin Support [WFAdam](https://wordpress.org/support/users/wfadam/)
 * (@wfadam)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/database-restore-breaks-2fa/#post-13387686)
 * Thanks again [@agreenstreet](https://wordpress.org/support/users/agreenstreet/)
   for your support!
 * As always, feel free to open another topic if you need any further assistance,
   we would be happy to assist!

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

The topic ‘Database Restore Breaks 2FA’ is closed to new replies.

 * ![](https://ps.w.org/wordfence/assets/icon.svg?rev=2070865)
 * [Wordfence Security - Firewall, Malware Scan, and Login Security](https://wordpress.org/plugins/wordfence/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordfence/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordfence/)
 * [Active Topics](https://wordpress.org/support/plugin/wordfence/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordfence/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordfence/reviews/)

## Tags

 * [2fa](https://wordpress.org/support/topic-tag/2fa/)

 * 5 replies
 * 2 participants
 * Last reply from: [WFAdam](https://wordpress.org/support/users/wfadam/)
 * Last activity: [5 years, 9 months ago](https://wordpress.org/support/topic/database-restore-breaks-2fa/#post-13387686)
 * Status: resolved