Those who frequently export and import WordPress from one hosting to another, or even from local servers to hosting or vice versa, often encounter situations or problems that need to be resolved in order to ensure that the import is done correctly and our website works well on the new servers.
Export and Import WordPress
Typically the steps for manual WordPress export without any plugin would be as follows:
- Export database via PhpMyAdmin.
- Compact the Site folder.
At the time of Importa we would do the following:
- Upload the compressed site folder to the new hosting and uncompress it.
- Import database by uploading it using PhpMyadmin.
- Search the database for the wp_options table.
- Replace the value of the siteurl and home options with the domain on the new server.
- Edit the wp_config.php file and update database name, database user and password.
- Log in as site administrator and save permalinks.
Here you can check the explanation with more details and images on how to manually export WordPress.
Up to this point we are doing well, but in the last attempts to import a WordPress website, as it had a MySQL 8 source database server and the destination hosting had a MariaDB database server, compatibility was compromised and step 2 of importing the database gave me the following error:
So because of this error the database is not imported correctly.
What to do to fix the Unknown collation error?
Having the .sql file of the database we want to import, we use a code editor such as Notepad++ and then search and replace the following “collation” throughout the file.
- utf8mb4_unicode_ci para utf8_unicode_ci
- utf8mb4 para utf8
- utf8_unicode_520_ci para utf8_unicode_ci
Of course the Database collation in the configuration must be utf8_unicode_ci.
Then we import the database and we will see that it works without giving any error.
We then continue with the other import steps and we will have a WordPress website working correctly on our new Hosting.
No comment