• Archives
  • Cryptocurrency
  • Earnings
  • Enterprise
  • About TechBooky
  • Submit Article
  • Advertise Here
  • Contact Us
TechBooky
  • African
  • AI
  • Metaverse
  • Gadgets
Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Search in posts
Search in pages
  • African
  • AI
  • Metaverse
  • Gadgets
Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Search in posts
Search in pages
TechBooky
Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Search in posts
Search in pages
Home Open source

How to Safely Migrate a WordPress Site to a New Server (Step-by-Step Guide)

Paul Balo by Paul Balo
March 25, 2025
in Open source, Tips
Share on FacebookShare on Twitter

6. Handling Serialized Data After URL Changes (Better Search Replace)

When changing URLs in the database, a simple find-and-replace can break data that’s stored in serialized format (a common storage format in WordPress options and widget data). Serialized data includes the string length of stored values, so if a URL length changes, the serialization needs to update too. For example, replacing “oldsite.com” with “newsite.com” changes the character count, and if not done carefully, it can corrupt the entry, causing plugin settings or widgets to break.

To safely update all instances of the old URL to the new URL in the database, use a tool that understands serialization. Fortunately, there are WordPress plugins and tools designed for this. A highly recommended one is the Better Search Replace plugin. Using Better Search Replace Plugin: Install and activate the Better Search Replace plugin on the new site (you can do this via WP Admin, or download the plugin files and upload them to wp-content/plugins/ if you can’t access admin yet). In WP Admin, go to Tools -> Better Search Replace. In the plugin interface, you’ll specify a search string and a replace string. Use your old site URL (e.g., oldsite.com) as the search, and your new site URL (newsite.com) as the replace. Select all tables (or at least all tables where URLs might appear – usually all WordPress tables). Run it as a dry run first (the plugin has a checkbox for “Run as dry run”) to see how many replacements it would make, without actually changing data​. If the results look plausible, uncheck dry run and run again to perform the replacements. This plugin will handle serialized fields properly, ensuring data integrity​

The Better Search Replace plugin provides a user-friendly interface to find all occurrences of the old URL in the database and replace them with the new URL, while safely handling serialized data. Using Better Search Replace will update URLs inside page content, widget data, settings, etc. For instance, image URLs in your posts that pointed to oldsite.com/wp-content/uploads/... will be changed to newsite.com/..., ensuring media and links aren’t broken. It will also catch things like GUIDs in the posts table, old domain references in some plugin options, and so on.

Alternate Tools: In lieu of a plugin, developers sometimes use WP-CLI’s search-replace command (which also handles serialization)​ or the third-party Search and Replace for WordPress Databases script​

. WP-CLI example:
wp search-replace 'oldsite.com' 'newsite.com' --skip-columns=guid --dry-run

then run without --dry-run to execute. This does essentially the same job. The plugin method is more accessible via a UI.

After running the search/replace, your new site’s database should have no references to the old domain (except perhaps in places like backup plugin records or historical data). At this point, if you visit the site on the new server’s URL, all links should point correctly to that URL. This is a major step in avoiding broken links or mixed content issues.

Note: If you kept the same domain name and are only changing hosts, you do not need to do a domain search-replace (since the domain is identical). However, if the site was in a different subdirectory on the old server and now in root (or vice versa), or if the URL protocol changed (http to https), a similar search-replace might be needed for those scenarios. Always back up the DB before running mass search-replace just in case.

Related Posts:

  • WordPress theme switch
    A Comprehensive Guide to Resolving File Permissions…
  • wp-speculative-loading-plugin-page-speed-e1712935040275
    WordPress Launches Speculative Loading Plugin To…
  • blog5f352fc3b2393_wp
    Hackers Exploit Popular WordPress Backup Tool Used…
  • https___dev-to-uploads.s3.amazonaws.com_uploads_articles_kqmbj9rjwqfghln5r5jv
    How to Convert SQL Server to Postgres
  • images (2)
    The Untold Story of WordPress and WP Engine's Clash
  • WordPress_blue_logo.svg
    WordPress Launches Revolutionary 100-Year Domain…
  • assets_task_01jrfxkvwqeexbx349fmgw9baz_img_0
    Schema Markup in WordPress: A Step-by-Step Guide to…
  • How-to-connect-to-EC2-instance-via-SSH-Linux-1
    Recovering SSH Access on AWS - A Step-by-Step Guide

Discover more from TechBooky

Subscribe to get the latest posts sent to your email.

Page 6 of 11
Prev1...567...11Next
Tags: tipswordpresswordpress migration
Paul Balo

Paul Balo

Paul Balo is the founder of TechBooky and a highly skilled wireless communications professional with a strong background in cloud computing, offering extensive experience in designing, implementing, and managing wireless communication systems.

BROWSE BY CATEGORIES

Receive top tech news directly in your inbox

subscription from
Loading

Freshly Squeezed

  • Cursor Introduces An AI Coding Tool For Designers December 12, 2025
  • OpenAI Unveils More Advanced Model as Google Rivalry Grows December 12, 2025
  • WhatsApp Is Redefining The Voicemail Features For Users December 12, 2025
  • Microsoft’s Nadella Is Building a Cricket App in His Spare Time December 12, 2025
  • Google Photos Expands ‘Remix’ Feature to More Countries December 12, 2025
  • Google Play Store Reinstates Fortnite December 12, 2025
  • Vodacom Announces Price Hike December 12, 2025
  • ChatGPT Set to Launch ‘Adult Mode’ By Q1 2026 December 12, 2025
  • Amazon to Invest $35B in India by 2030 for Jobs & AI Growth December 11, 2025
  • SpaceX May Launch Its Big IPO Next Year With a $1tr Valuation December 11, 2025
  • GPT-5.2 Debuts as OpenAI Answers “Code Red” Challenge December 11, 2025
  • Netflix Plans Heavy Borrowing to Fund Warner Bros Deal December 11, 2025

Browse Archives

December 2025
MTWTFSS
1234567
891011121314
15161718192021
22232425262728
293031 
« Nov    

Quick Links

  • About TechBooky
  • Advertise Here
  • Contact us
  • Submit Article
  • Privacy Policy
Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Search in posts
Search in pages
  • African
  • Artificial Intelligence
  • Gadgets
  • Metaverse
  • Tips
  • About TechBooky
  • Advertise Here
  • Submit Article
  • Contact us

© 2025 Designed By TechBooky Elite

Discover more from TechBooky

Subscribe now to keep reading and get access to the full archive.

Continue reading

We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.