• Resolved Sonja London

    (@summit)


    I seem to have 2 sets of wordfence tables in a few of my sites. One is lowercase, the other mixed (camelcase?). Here is one example:

    • wp_wfbadleechers
    • wp_wfBadLeechers

    How do I:

    • Determine which is in use?
    • Clean it up?
    • Prevent this from happening again?

    Any idea whether this was caused by some changes in WordFence or operating system differences when moving the site?

    https://www.ads-software.com/plugins/wordfence/

Viewing 8 replies - 1 through 8 (of 8 total)
  • WFSupport

    (@wfsupport)

    Hi

    Did you reinstall the WF plugin and do a database import when moving the site?

    tim

    Thread Starter Sonja London

    (@summit)

    We have tried uninstalling & reinstalling.

    The import failed. That was where we discovered the duplicate tables. We used Duplicator on linux host with live site to create the .zip for import to DesktopServer.

    We had previously used DesktopServer to deploy directly from windows to live linux host.

    I am still not clear at which point the duplicate tables appeared, but it appears related to the fact that the WordFence tries to create tables using mixed case names. Mixed case table names are NOT supported on all combinations of OS/MySQL engine choice. While this may work if databases are never moved between OSs, this is problematic when moving databases from one OS to another.

    Here is an excerpt form the MySQL manual:

    By default, table aliases are case sensitive on Unix, but not so on Windows or Mac OS X. …

    To avoid problems caused by such differences, it is best to adopt a consistent convention, such as always creating and referring to databases and tables using lowercase names. This convention is recommended for maximum portability and ease of use.

    WFSupport

    (@wfsupport)

    Actually the reason I asked was that if you imported the database as a whole from old site to new site, then installed wordfence, maybe your desktop server tried to create the tables but had to change the case to create the new ones because the old ones were already there. Do you happen to have a link to desktop server, so I know exactly what you are using?

    Thanks

    tim

    Thread Starter Sonja London

    (@summit)

    Thread Starter Sonja London

    (@summit)

    If it helps, DesktopServer is software that adds functions to XAMPPlite like export, import, VHOSTS handling and more. Like MAMP pro but better.

    If using the database engine “MyISAM”, case sensitivity of database and table names can vary on different Operating Systems and based upon the MySQL configuration. REF: https://dev.mysql.com/doc/refman/5.5/en/identifier-case-sensitivity.html

    If using the database engine “InnoDB”, on Windows it always uses lowercase database and table names (irregardless of the MySQL configuration). REF: https://dev.mysql.com/doc/refman/5.5/en/innodb-restrictions.html

    WordPress (and most database installation tools) will use the default database engine configured by the database server (unless requested otherwise). As of MySQL 5.5, the default database engine is InnoDB. REF: https://dev.mysql.com/doc/refman/5.5/en/innodb-default-se.html

    WordFence uses camelCased tables names. Doing so complicates any database export / import between different database servers as case sensitivity regarding database and table names is not guaranteed consistent (even from UNIX to UNIX). I would strongly recommend future versions of WordFence use snake_case names (or all lowercase names) to avoid complications.

    In addition to server migration (from an old server to a new server), people maintaining separate “live” and “development” servers to allow for testing without impacting the “production” website are also impacted by the use of camelCase table names.

    Thread Starter Sonja London

    (@summit)

    Is there any chance WordFence will get rid of the troublesome camelCase names?

    Plugin Author WFMattR

    (@wfmattr)

    It is possible that it will change in a future version, but I cannot say for sure yet. Our reference number for this issue is FB1078. Windows is not officially supported by Wordfence, but I do see how this could be helpful for local development.

    If you are able to exclude the Wordfence tables from the database export when moving from the development server to the live server, that may help for now. In most cases, it is best not to update the Wordfence tables on a live server from a dev server, since it would overwrite any recently blocked IPs and similar data, for events that happened after the live site was originally copied. (Of course, if you change any Wordfence options on the dev server, those changes also would not be copied.)

    -Matt R

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘duplicate tables’ is closed to new replies.