Is there a proper way of exporting and importing a big WordPress MySQL database to a new database?
When I tried to do that in the standard way I run into 2 issues:
-
All widgets disappeared and I had to create them from scratch
-
I had issues with special characters such as
'
and I had to search and replace the gibberish letters
This is quite important as I need to move to a managed server from shared hosting. All apache, php, MySQL versions will be the same.
Ps: this will have to be SSH commands as phpadmin times out due to the database size.
I normally use mysqldump and sed:
on old server:
on new server:
sed is used to search and replace all the hard coded occurrences of the website if needed.
When your domain name or URLs change there are additional concerns. The files and database can be moved, however references to the old domain name or location will remain in the database, and that can cause issues with links or theme display.
If you do a search and replace on your entire database to change the URLs, you can cause issues with data serialization, due to the fact that some themes and widgets store values with the length of your URL marked. When this changes, things break. To avoid that serialization issue, you have three options: