• Resolved agreenstreet

    (@agreenstreet)


    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

    (@wfadam)

    Hello @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 4 years, 2 months ago by WFAdam.
    Thread Starter agreenstreet

    (@agreenstreet)

    Hi @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 4 years, 2 months ago by agreenstreet.
    Plugin Support WFAdam

    (@wfadam)

    Hello again @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/

    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

    (@agreenstreet)

    Hi @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

    (@wfadam)

    Thanks again @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.