Change log
- Fixed: Uncaught runtime errors in search and replace process.
- Fixed: Issues with database export with custom post connections.
- Fixed: Connection to mysql failed with message: SQLSTATE[HY000] [1042].
- Fixed: Connection to mysql failed with message: SQLSTATE[HY000] [2002] Connection refused.
Better database connection handling using PDO
There are issues with some host when exporting a database, this is when creating the package. Before this release – Prime Mover always open a PDO (PHP Data Objects) instance completely including the database port. But this is not the case in all WordPress hosting.
There are observed scenarios where this current implementation will not work such as:
- They only allow PDO instance in standard host + username + password. It does not include it’s dB port. If you create an instance including it’s port – it returns connection refused error.
- Some hosting (especially those using latest MySQL 8.0) looks a bit odd because they are using a different port when connecting to WordPress vs the one that is being returned by the query:
SHOW VARIABLES WHERE Variable_name = 'port'
All of these issues are now fixed with Prime Mover 1.9.0+.
Troubleshoot PDO Connection refused error
With Prime Mover 1.9.0+, it offers easier ways to troubleshoot and fixed connection refused error when exporting database:
- Export or create package the normal / usual way. Prime Mover plugin handles the database connection automatically and this work in most hosting platforms.
- In rare situations where you are still getting connection refused runtime error (even using Prime Mover 1.9.0+). Please consult your hosting support as to what MySQL port they are using to connect to PDO connections using a third party script.
- Once they provide with the correct MySQL port to connect. Set the following in your wp-config.php:
define('PRIME_MOVER_FORCE_DB_PORT', 123456);
The above example assumes your host uses Port 123456.
- Retry the export and by this time – you should not be getting the same connection refused runtime error.
Improved handling of search and replace runtime errors
Technical support often get tickets related to search and replace runtime errors. Investigating the nature of these errors reveals that it’s often caused by an already existing corrupted or problematic data in the source site.
The cause of corruption in the source site is obviously not migration related but it’s already been there for some time even before migration. Usually the causes are inactive plugins or any other plugins that leave their own custom data inside the database uncleaned after the plugin was uninstalled.
Prime Mover cannot fix this because actually during migration – it cannot restore and fix the corrupted value without knowing it’s true value. Before – a runtime error or exception is thrown for these type of errors. Now it is being handled, logged and skip so as not to cause unexpected runtime errors.
Contact technical support
Do you have issues using Prime Mover plugin? Please let us know by dropping us a message. Thank you!