Background of the issue:
I imported a WPML live website into another server using 'All in one migration' and 'Wp Vivid import' plugins. The site is under development.
Symptoms:
I'm getting junk characters for some of the translated content after importing the site.
Questions:
How can we fix the junk characters issue for translated content after import?
Hi There!
I hope you're doing well. I've taken over this ticket and will try my best to assist you in this matter.
From the WPML Debug Info, the database `charset` is set to `utf8mb4`, and the `collation` is `utf8mb4_unicode_520_ci`, which is generally compatible with modern WordPress and WPML. However, the collation "utf8mb4_unicode_520_ci" is newer and not always supported on older servers or PHP versions. Check if the previous server (the source) was using the same collation or a different one (e.g., utf8mb4_unicode_ci or utf8_general_ci). If the collation differs, inconsistency may cause encoding issues.
Please check all the tables in the Database and set the collation for tables and columns to "utf8mb4_unicode_ci" for better compatibility.
ALTER TABLE your_table_name CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
Repeat this for all tables on the database. Please MAKE SURE to take a FULL BACKUP of the site and Database before running any database operation.
Please try and let me know how it goes. I'll be happy to help if you need further assistance in this matter.
Our current WordPress server configuration uses "charset": "latin1" and "collate": "latin1_swedish_ci". However, WPML and WordPress community forums recommend switching to utf8 or utf8mb4_unicode_520_ci for better compatibility with Indian languages and other non-Latin scripts. This change ensures proper rendering and support for multilingual content, particularly for characters outside the Latin set.
To resolve this, we attempted to migrate the database character set and collation to utf8mb4_unicode_520_ci (the latest version). However, the process requires a systematic approach to avoid potential data loss or corruption. Please confirm how this migration can be fully implemented and tested for optimal compatibility with WPML and Indian languages.
Let us know the exact steps or any additional considerations to ensure a smooth transition.
I understand your concern. To enhance compatibility with WPML and ensure better support for Indian languages, we recommend migrating your database to the `utf8mb4` charset with the `utf8mb4_unicode_ci` collation, replacing the current Latin-based configuration. The `utf8mb4_unicode_ci` collation is highly compatible and widely supported.
I'm sharing the process below.
1. Create a full backup using phpMyAdmin, `mysqldump`, or a WordPress backup plugin.
2. Update WordPress Configuration: Modify `wp-config.php`:
3. Convert Your Database: Manually update the charset and collation in Database table using the following SQL Query:
ALTER TABLE table_name CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
4. Verify Changes: Check that all tables and columns use the new charset and collation:
SELECT TABLE_NAME, TABLE_COLLATION FROM information_schema.TABLES WHERE TABLE_SCHEMA = 'your_database_name';
5. Test WPML and Site Functionality: Ensure that multilingual content displays properly and no characters are corrupted. Updating the collation should not result in any loss of content.
6. Perform the changes on a staging site first. Test thoroughly before applying them to your live site.
I hope the steps above will help to change the collation and charset properly. If you need further assistance, feel free to reach out. I'm here to assist!
Best regards,
Prosenjit
The topic ‘[Closed] When i import a WPML site to another hosting server im getting junk character for some of the transl…’ is closed to new replies.