TechBooky AI Assistant
TechBooky AI Assistant
👋 Welcome to TechBooky AI Assistant

I can help with:
🔎 Tech News
🤖 AI Topics
💻 Gadgets
☁️ Cloud
✍️ Guest Posts
📢 Advertising
🔗 Backlinks
📩 Newsletter
  • AI Search
  • 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

5. Changing the Site URL and Home URL in the Database

After migrating, one common issue is the site still trying to use the old URL. This is especially true if you are moving to a new domain or if you haven’t switched DNS and need to test the site at a temporary address. WordPress stores the site’s URL in the database (in the wp_options table) under the siteurl and home options. We need to update the site URL in the database so that WordPress knows it’s running on the new domain or new path.

When to change: If you are migrating to a different domain (e.g., from oldsite.com to newsite.com), you must update these. If you are keeping the same domain, but just moving servers, you typically do not change siteurl/home in the database (since the domain stays the same). In that case, you may skip this step, or only do it when you’re ready to flip DNS. However, when testing a migrated site before DNS switch (e.g., via hosts file or a staging subdomain), it can be useful to temporarily change the site URL so the site is accessible at the new location without redirecting back to the old domain.

There are a few ways to update these values:

  • Via SQL: You can run an SQL query on the new database (through phpMyAdmin or WP-CLI) to update the wp_options table. For example:

    UPDATE wp_options
    SET option_value = 'http://newsite.com'
    WHERE option_name IN ('siteurl','home');

    Replace 'http://newsite.com' with your new URL (make sure to include the correct protocol, http:// or https://, and no trailing slash). This query will set both the “WordPress Address (URL)” and “Site Address (URL)” to the new domain in one go. In phpMyAdmin, you can also simply browse the wp_options table, find the rows for siteurl and home, and edit them manually​, entering the new URL.

  • Via wp-config.php (temporary method): Alternatively, you can add the following two lines in wp-config.php to override the database values:

    define('WP_HOME', 'http://newsite.com');
    define('WP_SITEURL', 'http://newsite.com');

    This is a quick way to force WordPress to use the new URL (useful if you can’t access wp-admin due to URL issues). This should be removed later once the DB is properly updated, but it can get you into the admin to run search-replace operations.

  • Via WordPress Admin: If the site is already accessible on the new domain, you could log in and go to Settings -> General and change the WordPress Address and Site Address to the new URL. However, often right after migration you might not be able to log in until the URL is fixed, so this method isn’t always available.

Why this matters: If siteurl still points to the old domain, you may experience redirect loops or be sent back to the old site when trying to access the new one​. Updating these ensures the new site knows its correct address. For example, a common symptom is attempting to log in to wp-admin on the new server and getting bounced back to the old site’s login – that’s usually because siteurl/home are still the old URL, causing WordPress to redirect.

Go ahead and update siteurl and home in the database of the new site to reflect the new location. After doing so, if you access the site at the new URL (perhaps via your hosts file if DNS isn’t switched), the site should load from the new server without trying to reference the old domain. Keep in mind that this step alone only updates the core site address – many other URLs (like image links or page links in your content) may still point to the old domain, which we’ll handle next.

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…
  • bluesky-social-app-inc-GettyImages-1252042401_537192_e2lpcg
    Bluesky Adopts Long-Form Content To Rival X Articles

Discover more from TechBooky

Subscribe to get the latest posts sent to your email.

Page 5 of 11
Prev1...456...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

  • Google’s Gemini Can Now Take Notes For You In Google Meet June 30, 2026
  • Cursor Brings Its AI Coding Agents to Mobile With New App June 30, 2026
  • TIDAL Moves to Block Payouts for Fully AI‑Generated Music June 30, 2026
  • OpenClaw Brings Its Agentic AI Apps to iOS and Android June 30, 2026
  • New Data Shows Heavy AI Users Are Hiring More Especially at Entry Level June 30, 2026
  • Report: Google Put Limits on Meta’s Heavy Gemini Usage After Token Surge June 29, 2026
  • UK Plans AI Face Scans To Judge Asylum Seekers’ Ages Despite Known Bias Risks June 21, 2026
  • Trump Reportedly Mocked Zuckerberg and Bezos After Their Private Messages. Were We All Watching a Tech Industry Loyalty Contest? June 19, 2026
  • Snap Launches $2,195 AR Glasses to Challenge Phones June 17, 2026
  • Android 17 Is Here and Google Wants Gemini to Run Your Entire Phone June 17, 2026
  • SpaceX Buys Cursor Maker Anysphere for $60 Billion in Bold AI Power Play June 17, 2026
  • Britain’s Under-16 Social Media Ban Could Redefine Big Tech’s Responsibility To Children June 15, 2026

Browse Archives

June 2026
MTWTFSS
1234567
891011121314
15161718192021
22232425262728
2930 
« May    

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
  • AI Search
  • 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.