<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Complex CMS Migration Service - Migrate Content (Posts about encoding)</title><link>https://migratecontent.com/</link><description></description><atom:link href="https://migratecontent.com/categories/encoding.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><lastBuildDate>Mon, 23 Mar 2026 11:24:02 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Importing a WordPress database: How to fix the Unknown collation: 'utf8mb4_unicode_ci' error</title><link>https://migratecontent.com/wordpress-how-to-fix-unknown-collation-error/</link><dc:creator>Anthony Lopez-Vito</dc:creator><description>If you do a lot of exporting and importing to different database servers, you'll be familiar with the frustration of encountering MySQL import errors. Every so often when importing a WordPress dump file into a client's database, I will encounter an &lt;em&gt;Unknown collation&lt;/em&gt; error like the following:

&lt;code&gt;Unknown collation: 'utf8mb4_unicode_ci'&lt;/code&gt;

Sometimes it will come up as:

&lt;code&gt;Unknown collation: 'utf8mb4_unicode_520_ci'&lt;/code&gt;

This is caused by a difference in encoding types between the source and destination databases. It usually happens when you export from a newer MySQL database (MySQL 5.5.3 and above) which &lt;a href="https://dev.mysql.com/doc/refman/5.7/en/charset-unicode-utf8mb4.html"&gt;uses &lt;code&gt;utf8mb4&lt;/code&gt;&lt;/a&gt;, then attempt to import into an older version using &lt;code&gt;utf8&lt;/code&gt;. If you are importing from a dump file generated from a MySQL 5.6 database, you may get the &lt;em&gt;utf8mb4_unicode_520_ci&lt;/em&gt; message. The &lt;em&gt;520&lt;/em&gt; refers to &lt;a title="utf8mb4_unicode_520_ci: Unicode Collation Algorithm new version" href="https://dev.mysql.com/worklog/task/?id=2673#tabs-2673-4"&gt;MySQL's use of&lt;/a&gt; Unicode Collation Algorithm 5.2.0. Unknown collation errors may also happen if you are trying to import a &lt;a title="MariaDB versus MySQL - Compatibility" href="https://mariadb.com/kb/en/mariadb/mariadb-vs-mysql-compatibility/"&gt;MariaDB&lt;/a&gt; database into MySQL. I tend to get &lt;em&gt;unknown collation&lt;/em&gt; errors with my Rackspace Cloud accounts after Rackspace started offering MariaDB as a database option.

Ideally one would upgrade the older destination database but this isn't always a realistic option. There are a number of discussion threads on the &lt;a href="https://wordpress.org/support/topic/collation-error-utf8-mb4#post-6884157"&gt;WordPress forum&lt;/a&gt; about what to do. Fortunately, many web hosting accounts have a phpMyAdmin interface which provides an easy work-around for the problem.
&lt;h2&gt;Format-specific options during a phpMyAdmin database export&lt;/h2&gt;
&lt;ol&gt;
 	&lt;li&gt;Log in to your database server using phpMyAdmin&lt;/li&gt;
 	&lt;li&gt;Make sure you select your database and go to the "Export" tab&lt;/li&gt;
 	&lt;li&gt;Select the "Custom" radio button&lt;/li&gt;
 	&lt;li&gt;Go the section "Format-specific options" and in the setting for "Database system or older MySQL server to maximize output compatibility with:" select &lt;strong&gt;MYSQL40&lt;/strong&gt;.&lt;/li&gt;
 	&lt;li&gt;Scroll to the bottom and click &lt;strong&gt;GO&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;!-- image removed: phpmyadmin-format-specific-options.png --&gt;

Other possible solutions include:
&lt;ul&gt;
 	&lt;li&gt;&lt;a title="Unknown collation question on stackoverflow" href="http://stackoverflow.com/a/31506831"&gt;doing a search and replace&lt;/a&gt; on the database dump file;&lt;/li&gt;
 	&lt;li&gt;&lt;a href="http://stackoverflow.com/a/30005743"&gt;converting the character set&lt;/a&gt; to &lt;code&gt;utf8_general_ci&lt;/code&gt;;&lt;/li&gt;
 	&lt;li&gt;converting the database for &lt;a href="https://mathiasbynens.be/notes/mysql-utf8mb4"&gt;full Unicode support&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
Since many of my WordPress database migrations are under my &lt;a title="Drupal to WordPress migration service" href="https://migratecontent.com/drupal-to-wordpress-migration-service/"&gt;migration service&lt;/a&gt;, I don't always have control over the client's platform. The phpMyAdmin export format method is often the simplest solution.
&lt;h2&gt;Side-effects of a character encoding downgrade&lt;/h2&gt;
You might be wondering about the purpose of encoding types and if there will be any side-effects of downgrading. Character encoding allows support for a set of characters, such as the Western alphabet, Asian scripts and non-alphanumeric symbols. Older &lt;code&gt;utf8&lt;/code&gt; databases support a smaller set of characters whereas &lt;code&gt;utf8mb4&lt;/code&gt; includes &lt;a title="Emoji, WordPress, and You" href="https://kraft.im/2015/03/emoji-wordpress-and-you/"&gt;emojis, musical notation and Chinese Han characters&lt;/a&gt;. If you've ever exported a website from one CMS to another and found random characters scattered throughout the copy, it's because of an incompatible character encoding.

Solving the &lt;em&gt;unknown collation&lt;/em&gt; error as described here could mean you'll end up with unsupported characters after your site migration. However, as with many of my &lt;a title="Drupal to WordPress migration tool" href="https://migratecontent.com/drupal-to-wordpress-migration-tool/"&gt;Drupal to WordPress migration&lt;/a&gt; clients, in all likelihood you'll be migrating &lt;em&gt;from an older&lt;/em&gt; &lt;code&gt;utf8&lt;/code&gt; Drupal database &lt;em&gt;to a newer&lt;/em&gt; &lt;code&gt;utf8mb4&lt;/code&gt;-supported WordPress database. In this case, your old content will not have characters that will cause a problem after an encoding downgrade.</description><category>character</category><category>database</category><category>drupal</category><category>encoding</category><category>migration</category><category>troubleshooting</category><category>wordpress</category><guid>https://migratecontent.com/wordpress-how-to-fix-unknown-collation-error/</guid><pubDate>Fri, 13 May 2016 14:57:04 GMT</pubDate></item></channel></rss>