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 With TechBooky
  • 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
Share this story

Send it to someone who should read it.

f Facebook X X in LinkedIn wa WhatsApp tg Telegram @ Email
In Brief
  • 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...
  • WordPress stores the site’s URL in the database (in the wp_options table) under the siteurl and home options.

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:

    Also worth reading
    Schema Markup in WordPress: A Step-by-Step Guide to Rich Result Recovering SSH Access on AWS – A Step-by-Step Guide Too Much Gemini? Here’s How To Dial Back Gemini In Your Google Workspace Apps How One Engineer Built a Local AI News Roundup With Docker & Qwen A Comprehensive Guide to Resolving File Permissions and Theme Issues How to Convert SQL Server to Postgres
    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 Reading

More contextual TechBooky stories selected from tags, categories and article context.

  • 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
Keep Reading Smarter

Search TechBooky with AI

Use TechBooky's AI Search to explore the context behind this story and related coverage across the site.

Try AI Search
More On This Topic
Open source Tips
Follow TechBooky

Follow TechBooky for more technology stories and newsroom updates.

f Facebook X X in LinkedIn ig Instagram wa WhatsApp

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.

Search TechBooky
Open TechBooky AI Search Try the AI Assistant

BROWSE BY CATEGORIES

Receive top tech news directly in your inbox

subscription from
Loading

Freshly Squeezed

  • Rivian Spinout ALSO Turns E-Bikes Into An Autonomous Delivery Bet August 23, 2026
  • Apple’s Foldable iPhone May Be Real, But The Trade-Offs Are Too August 23, 2026
  • Apple Job Cuts Point To A New Siri And Vision Pro Reset August 22, 2026
  • TikTok’s $400M Privacy Settlement Shows Child Safety Costs Are Rising August 22, 2026
  • OpenAI Cuts GPT-5.6 Sol API Prices As AI Price War Deepens August 22, 2026
  • Apollo Data Breach Shows Wall Street’s Cloud Security Problem August 21, 2026
  • Tesla’s China Recall Turns Hidden Door Handles Into A Safety Issue August 21, 2026
  • Oura Lawsuit Puts AI Sleep Tracking Under Legal Pressure August 21, 2026
  • Ericsson And MTN Move MoMo Onto Cloud Across Four Markets August 21, 2026
  • Kenya’s Digital ID Talks Put Trust Back At The Centre August 21, 2026
  • Starcloud’s $250M Raise Pushes Orbital AI Data Centres Closer August 21, 2026
  • Micron’s $10B Boise Lab Makes Memory A Bigger AI Battleground August 21, 2026

Browse Archives

August 2026
M T W T F S S
 12
3456789
10111213141516
17181920212223
24252627282930
31  
« Jul    

Quick Links

  • About TechBooky
  • Advertise With TechBooky
  • 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 With TechBooky
  • 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.