WP Migrate DB is a free WordPress script that runs in the dashboard as a plugin and creates a database dump while changing all the URLs and handling serialised data strings.
You can save the database file to your computer as a gzip .SQL file and then import it into the destination website via a database management tool like the popular GUI phpMyAdmin or, if you prefer, the SSH tool PuTTY.
It’s helpful for developers wanting to clone a WordPress website to a localhost such as WAMP or vice versa. WP Migrate DB has solved a nasty database issue I had concerning serialised data when my normal method of cloning/migrating took a bad turn.
I’ll come on to my litigant of database complaints in a moment and how I got around them.
Below is the video provided by the makers of the plugin. This is a pretty straight forward scenario:
Database Issues & Discovery of WP Migrate DB
Usually, I build new client websites locally using WAMP, clone the database, replace the URLs, copy the website folder directory and install everything to the destination server.
This is what I call the manual method of exporting the .SQL from phpMyAdmin.
On this occasion, I had built the WordPress site WAMP (as per usual) but wanted to clone everything into an InstantWP installation for my client.
I followed common procedure and tried to replace the database URLs, as per usual, using the free script Search Replace DB without breaking serialised data.
All that needed to be done was to change the URLs from http://localhost/websitetest to http://127.0.0.1:4001/wordpress
WordPress Text Widgets Wiped Out
For some reason, on this occasion, the Search Replace DB script went wrong. The WordPress text widgets were wiped out on the destination server.
Everything else was there except text widgets in the header, sidebar, footer.
It wasn’t as though they’d been relegated to the “inactive widgets” area either, as is often the case when switching WordPress themes. The widgets simply weren’t there.
The data pertaining to them WAS still in the .SQL file which meant serialised data had ben broken for text widgets in the course of me running the SRDB script previously mentioned.
WP Migrate DB would be the answer.
Old URL > New URL
WP Migrate DB will find and replace all URLs in your database as well as unserialising and reserialising. This is taken care of before the database dump actually takes place.
Any serialised data pertaining to text widgets is handled as a result.
If you’re migrating a https website to your localhost, be sure to enter http: in the replace field.
If you don’t you’ll end up with a database full of URLs that look like https://localhost/yoursite and your site will not load in the localhost.
It seems WP Migrate DB is a fantastic choice and allows me to clone any WordPress website database on either a localhost or remote server and reproduce wherever I want.
But as you know, it depends on your “rig” – there are seemingly infinite combinations of software with WordPress and situations can differ hugely.
Download the plugin: