Database tables case issue

I’ve been taking a closer look at things and I think I have more information to help out with this issue. Thanks for you patience with this, and sorry for the delay – it’s been a tricky thing to zero in on.

It looks like the general issue has to do with the fact that Windows’ file system is case-insensitive, while the remote, UNIX-y file system is case sensitive. Because Windows is case-insensitive, this can cause problems with MySQL when changing environments.

The MySQL documentation goes into detail about these settings and recommends adopting a convention of all lowercase table names for maximum portability:

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.

https://dev.mysql.com/doc/refman/5.7/en/identifier-case-sensitivity.html

In terms of how to proceed so that you are able to pull the site down using Local, I would recommend updating the remote site’s table prefix to only have lowercase characters.

This is definitely something that you want to be careful of when doing, so definitely take a backup, and consider putting the remote site into maintenance mode while updating those table names.

In the above Mysql.com link, they outline the general workflow of exporting the db, running a search and replace on the dumped file, and then importing the database with the new table names.

In the case here with WordPress, you should be able to do something similar using wp-cli commands, so something like this:

wp db export db.sql
# update the sql file to have new table names
wp db reset
wp db import db.sql

Remember to update the wp-config.php file with the new table prefix so that the new table structure is being used for the WordPress site! Also, if your site has any custom queries or custom tables, make sure those are updated to take into account the change in table names!