Illegal mix of collations error

Tables and columns in a MySQL database are created with a “collation”, which dictates what characters can be used in the information. When new tables or columns are added to your TNG database during an upgrade, the database will use its default collation to create those. Normally that’s what we want, but if your default collation has changed since your tables were originally created, then you could end up with a mismatch that MySQL doesn’t like. That when you’ll see this message like this on your TNG site:

Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8mb4_general_ci,COERCIBLE)

To fix this, you’ll need to edit your database structure and fix the mismatch so that everything is using the same collation.

Start by opening phpMyAdmin on your site control panel (aka, the “cpanel”). Ask your hosting provider if you need help finding it (it’s not part of TNG).

Once you’re in phpMyAdmin, select your database by clicking on it in the left column. You should now see all the tables in the database on the right, and one of the things listed for each table is the collation. Scan the list and take note of the predominant collation (the one used the most).

Next, click the Operations tab at the top of the page. In the Operations window, look for the Collation section near the bottom. It looks like this:

Now use the dropdown list to select the predominant collation you noticed earlier, then check the boxes below to propagate the collation to all tables and columns:

Finally, click “Go” in the lower right corner to make the change.

Uploading folders with “replace” vs “merge”

One problem TNG site owners sometimes have during an upgrade is discovering that some images or other files are missing when the upgrade is complete. How did that happen?

The cause of this trouble is folders that get uploaded in “replace” mode (as opposed to “merge” mode). When a folder is uploaded in “replace” mode, the new folder totally replaces the old folder, so if there were any files not included in the new folder, those files will end up getting deleted from the website. In contrast, uploading in “merge” mode will allow the new files to overwrite older files with the same names, but it won’t delete anything.

So how do I know when my FTP program is in “replace” or “merge” mode? Unfortunately there’s no definitive answer, since all programs are different, so you might have to hunt around in your settings. In the popular Mac program “Transmit”, this can be found under Settings and then Transfers:

In that image, notice the “Uploading folders” option at the bottom. Here’s what it looks like with the options open:

There you can see that you have both a “Replace the existing folder” option and a “Merge the existing folder” option (among others). If you use a different program, you will likely have a similar option. Ask the company that makes the software if you’re not sure where to find it.

If you do end up replacing a folder when you didn’t mean to (and thus end up deleting some files), you can get them back by downloading the TNG full version zip and then uploading the folder again from there. That should restore all the default files from that folder for the current version. If you had custom images or files that were removed from the folder in question, you will need to upload those again as well.