Background: I downloaded a *.sql backup of my WordPress site\'s database, and replaced all instances of the old database table prefix with a new on
This script (https://interconnectit.com/products/search-and-replace-for-wordpress-databases/) can help to update an sql database with proper URLs everywhere, without encountering serialized data issues, because it will update the "characters count" that could throw your URLs out of sync whenever serialized data occurs.
The steps would be:
if you already have imported a messed up database (widgets not working, theme options not there, etc), just drop that database using PhpMyAdmin. That is, remove everything on it. Then export and have at hand an un-edited dump of the old database.
Now you have to import the (un-edited) old database into the newly created one. You can do this via an import, or copying over the db from PhpMyAdmin. Notice that so far, we haven't done any search and replace yet; we just have an old database content and structure into a new database with its own user and password. Your site will be probably unaccessible at this point.
This should have your database properly updated, without any serialized data issues around: the new URL will be set everywhere, and serialized data characters counts will be accordingly updated.
Widgets will be passed over, and theme settings as well - two of the typical places that use serialized data in WordPress.
Done and tested solution!