0

I am using Grunt to dump my local db, search and replace URLs in it (and account for serialization by using grunt-peach based on Peach), send it to my staging server, then import it into my staging db. I use Grunt because I can accomplish all of this with one quick command line entry.

However, after a successful db transfer to my staging server, any widgets—either custom widgets or the built in text widget that comes bundled with WordPress—do not appear on the frontend or in the backend (Appearance->Widgets screen) of my staging server after a transfer if they contain an internal link (i.e., a link to a page or post within my site). If they contain an external link (e.g., to stackoverflow.com) then the widget appears on the frontend and in the backend as expected.

I've examined the db entries for the widgets in question on the staging server after a successful transfer. The links are present, they correctly point to the staging server URL instead of my local URL, and the new character counts (serialization) appear correct.

Does anyone know what the issue could be and how I can ensure all of my widgets containing internal links transfer successfully?

EDIT: Upon further inspection, the serialization is not corrected after migration. I suspect this is a bug with Peach opened an issue.

1 Answer 1

0

  • Import the database on the new server.
  • 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:

    1. Use the Velvet Blues Update URLs or Better Search Replace plugins if you can access your Dashboard.
    2. Use WP-CLI's search-replace if your hosting provider (or you) have installed WP-CLI.
    3. Use the Search and Replace for WordPress Databases Script to safely change all instances. (If you are a developer, use this option. It is a one step process as opposed to the 15-step procedure below)

    Your Answer

    By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

    Not the answer you're looking for? Browse other questions tagged or ask your own question.