[Resolved] Need to migrate Automatic Translations From one site to another
This thread is resolved. Here is a description of the problem and solution.
Problem: You are trying to activate automatic translations on a WPEngine instance but encountered an issue where the system reports you are out of credits despite having allocated them. Additionally, on your local development instance, the WPML -> Translation Management -> Translation Tools page is endlessly loading, and you are seeing 500 errors from the WPML API indicating a MySQL server read-only error. Solution: The 500 errors and the MySQL server read-only messages suggest a server-side limitation, not an issue directly caused by WPML. This server state is preventing the automatic translation services from functioning correctly. For the credits issue, once credits are allocated in your WPML.org account for the WPEngine instance, they should appear there. The error about missing credits likely stems from the server's inability to validate the credit balance properly due to the same API access issue. When migrating from a development to a live environment, ensure you use the Automatic Translation Editor (ATE) for moving or copying the site to maintain the link between the instances and manage the translation memory effectively. If you skip the migration code, the sites won't be linked, which can overwrite the live site's organization ID and its translation memory.
If this solution does not resolve your issue or seems irrelevant due to being outdated or not applicable to your case, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If problems persist, please open a new support ticket at WPML support forum.
This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
Background of the issue:
I am trying to migrate automatic translations from one site to another. I have two development instances: one runs locally on my computer (hidden link) and the other runs on WPEngine (hidden link). I was trying to activate automatic translations on the WPEngine instance, but it informed me that I was out of credits despite allocating 2000 to the site in my account settings on the WPML website. I followed the instructions to copy the migration code from WPML -> Translation Management -> Translation Tools and pasted it on my local development instance, where the issue began.
Symptoms:
When visiting WPML -> Translation Management -> Translation Tools on my local development instance, the page is endlessly loading. I found two 500 errors from the WPML API. The first request to hidden link returned an error: 'Mysql2::Error: The MySQL server is running with the --read-only option so it cannot execute this statement'. The second request to hidden link returned the same error.
Further, I'm finding these errors in the Advanced Translation Editor Error logs as well. The event is "AMS Server Communication" and the extra data is {"errorData":{"status":500,"title":"Active record statement invalid","detail":"Mysql2::Error: The MySQL server is running with the --read-only option so it cannot execute this statement"}}
Questions:
1. It looks like I cannot make the change due to an error on the WPML end, is this correct? If so, please let me know if there is any more information I can provide to assist with troubleshooting the error so that it can be resolved on your end.
2. Do I need to migrate the automatic translations from my one dev instance to another in order to use the feature on the other dev instance, or are my credits not working on my WPEngine dev instance due to another issue?
Before this ticket gets assigned to one of my colleagues, I will try to help.
Thanks a lot for sharing all the details – it really helps us understand what’s going on.
From what we can see, the 500 errors and the message 'The MySQL server is running with the --read-only option so it cannot execute this statement' are pointing to a limitation on the server-side, not something caused directly by WPML. It seems the server where the request is being processed is currently in a read-only state, which blocks the automatic translation services from functioning properly.
Regarding the second question: the translations are saved into the database so, when you migrate the site in full (files+database), the translations should be copied/migrated, too. Credits are tied to the registered site, so once credits are allocated in the WPML.org account for the WPEngine instance/domain, they should just show up there. The error being shown about missing credits is most likely related to the server not being able to validate the credit balance properly due to the same API access issue.
Those 500 were occurring upon the plugin making requests to the WPML API, this can be seen by the URLs shown in my original ticket. Unless hidden link is not a wpml api, this appeared to be an issue on your end.
I won't be migrating the site, I'm only using the development instance to make the plugin work with the headless configuration we have. As a matter of fact, I don't want the translation memory on the production site as I have made a lot of translations just have the word "SPANISH" in them in order to validate the headless site requesting the correct data for the language.
Anyway, I'm no longer getting the 500 errors and I'm able to translate automatically, so it looks like the issue at hand was fixed since my ticket last week.
As far as clearing out the translation memory upon migrating, is this possible? Or, will it not migrate the translation memory unless I explicitly do so?
When migrating from Dev to Live, the system detects the URL change and prompts for confirmation. If you skip the migration code, the sites won’t be linked.
This can overwrite the Live site's organization ID — and its translation memory.
While we can fix this manually, it's not ideal if done often. I recommend linking Dev and Live properly using these steps:
Using ATE when moving or copying your site
Thank you for that information! We'll want the translation memory overwritten so that we can start fresh since I wasn't testing with real translations in the dev environment so this sounds perfect!
For any other migrations from there I'll be sure we use ATE when moving or copying the site.