Close Menu
SmartMag DigiTech

    Subscribe to Updates

    Get the latest creative news from FooBar about art, design and business.

    What's Hot

    Best Landing Page Builders for Fast Marketing Campaigns

    Nov 23, 2026

    Best Async Communication Tools for Distributed Teams

    Nov 21, 2026

    How to Use Search Console to Uncover Content Gaps

    Nov 20, 2026
    StackBench
    Demo
    • Home
    • Hosting & Domains
      • Hosting
      • Domains
      • Cloud & Servers
    • Web Tools
      • Web Tools
      • Website Builders
      • SEO Tools
      • Security Tools
      • Analytics
    • Marketing
      • Email Marketing
      • Marketing Stack
    • Software
      • Productivity
      • Business Software
      • Collaboration
      • CRM
    • Ecommerce
      • Ecommerce Tools
      • Freelancer Tools
      • Small Business
    • Guides
      • Comparisons
      • Buying Guides
      • How-To Guides
    SmartMag DigiTech
    Home/How-To Guides/How to Back Up Your Site Before You Switch Hosts
    Hosting

    How to Back Up Your Site Before You Switch Hosts

    By Maya EllisonJul 8, 20255 Mins Read211 Views
    How to Back Up Your Site Before You Switch Hosts

    The email from the new host arrives with a login link and a cheerful countdown clock. Migration starts in seventy-two hours. What that email does not say, and what the dashboard rarely makes obvious, is that the old host will begin deleting files the moment the billing period closes, and any backup still sitting on the old server goes with them. The backup has to live somewhere else before the switch begins, in a place the old host cannot reach and the new one has not yet touched.

    Most site owners discover this in the worst possible order: they point the domain at new nameservers, watch the new host pull a broken copy of the database, and only then go looking for the export they assumed was automatic. The assumption is the trap. A host's built-in backup tool is a convenience for restoring on that same host. It is not a migration kit, and it rarely produces files a person can hand to a different company.

    What a complete backup actually contains

    A WordPress site is two things wearing one coat. The first is a set of files: the core installation, the theme, the plugins, the uploads folder where every image and PDF lives. The second is the database, a MySQL dump that holds posts, pages, users, settings, and the quiet little rows that connect a product to its category. Copy one without the other and the result is a site that loads but shows nothing, or a database that points at images which no longer exist.

    There is a third piece people forget: the configuration file. The wp-config.php file holds the database credentials, and those credentials are tied to the old host's server. A backup that includes wp-config.php will restore a site that cannot connect, because the file still points at a database that is about to be deleted. Keep the file for reference, note the table prefix inside it, and plan to regenerate the credentials on the new host.

    Email accounts, cron jobs, and SSL certificates sit outside both files and database. A site migration vendor will often handle the certificate. Email is a separate conversation with the new host, and it is worth having that conversation before the DNS change rather than after, when mail sent to the old address starts bouncing.

    Exporting the database without corrupting it

    The database export is where migrations quietly fail. A live site writes to its database constantly: a comment arrives, a plugin logs a cron event, a customer adds an item to a cart. An export taken while those writes are happening can capture a table mid-write and produce a dump that imports with errors, or imports cleanly and then shows a handful of missing rows weeks later.

    The clean approach is to put the site into maintenance mode first, which stops most front-end writes, then export through the host's phpMyAdmin or a command-line mysqldump. The command-line version is faster on large databases and gives a progress indicator. A dump of a mid-sized WordPress site, say a few hundred posts and a few thousand images, often lands somewhere between 50 and 300 megabytes once compressed, and the export should be checked for the closing comment that mysqldump writes at the end of a successful run.

    Compression matters more than people expect. An uncompressed SQL file of a busy store can run into the gigabytes, and many hosts cap upload size on the import side. Gzip the dump before moving it. If the new host's importer rejects the file for size, the standard workaround is to split the dump by table or raise the upload limit through a php.ini directive, though the second option depends on whether the new host allows it.

    Pulling the files down over a slow connection

    The uploads folder is almost always the heaviest part of the file set. A photography site or a shop with thousands of product images can hold tens of thousands of files, and dragging that folder through a desktop FTP client over a home connection is an exercise in patience and dropped transfers. The better route is to compress the entire public directory into a single archive on the server, then download that one file.

    Most hosts offer a file manager with a compress command, or SSH access where a single tar command does the job in seconds. The archive should be pulled down to local storage and then, ideally, copied to a second location: an external drive, a cloud bucket, anything that is not the laptop that might get coffee spilled on it. Two copies in two places is the minimum for a migration, because the whole point is that one copy is about to be destroyed.

    File permissions travel badly through archives. When the files are extracted on the new host, directories usually need to be 755 and files 644, and the wp-config.php file is often tighter. A migration that produces a white screen or a 403 on every page is frequently a permissions problem, not a missing file. Checking ownership and mode after extraction saves an hour of confused debugging.

    The plugin shortcut and where it breaks

    Migration plugins exist for a reason, and for a straightforward brochure site with a modest uploads folder they work well. The plugin packages the database and files into a single archive, and the new host runs an installer that unpacks everything and rewrites the site URL. The convenience is real, and the failure modes are predictable.

    Large sites time out. A shared host with a 30-second execution limit will kill the export mid-package, and the resulting archive will be incomplete without saying so. Some plugins serialize data in ways that break when the new host runs a different PHP version. Others leave stale URLs in the database, so images load from the old domain until it goes dark, at which point every image on the site disappears at once.

    The honest position is that a plugin is fine as a first attempt and a poor choice as the only attempt. Running a manual database dump and a manual file archive alongside the plugin costs an extra twenty minutes and gives a fallback that does not depend on a third-party tool behaving correctly on a server it has never seen.

    Rewriting URLs before anything goes live

    WordPress stores the site address in the database in two places, and it also embeds the old domain inside post content, widget settings, and serialized plugin options. A search-and-replace on the raw SQL is risky because serialized data encodes string lengths, and changing the length of a URL inside a serialized string corrupts the whole record. The safe method is a tool that unserializes, replaces, and reserializes, or the WP-CLI search-replace command, which handles this correctly.

    The replacement should run against the imported database on the new host before the domain is pointed over. Testing with a hosts file entry or a temporary subdomain confirms that pages load, images resolve, and forms submit while the old site is still serving live traffic. A migration that goes wrong at this stage is recoverable in minutes; one that goes wrong after the DNS change is recoverable in hours, with angry customers in between.

    Verifying the backup is restorable, not just present

    A backup that has never been restored is a hope, not a backup. The single most useful step in the entire process is to take the archive and the database dump and restore them somewhere harmless: a local development environment, a cheap staging server, a subdirectory on the new host. If the site loads there with images, menus, and a working login, the backup is real. If it does not, the failure surfaces while the old host is still alive and the original files are still on disk.

    This test catches the specific problems that only appear on restore: a missing uploads subfolder, a database user without the right grants, a plugin that phones home to a license server keyed to the old domain. Each of those is a small fire that is easy to put out before the switch and hard to put out after.

    The old host's cancellation window

    Hosts differ on how long they keep a terminated account's data. Some delete it within days. Some keep a cold archive for a month and will restore it on request, sometimes for a fee. Some keep nothing and say so only in the terms of service. The safe assumption is that the moment the cancellation is processed, the data is gone, and the backup taken beforehand is the only copy that exists.

    That timing shapes the order of operations. The backup runs first, the restore test runs second, the DNS change runs third, and the cancellation runs last, after the new site has been live for several days and the old one has stopped receiving traffic. Cancelling early to save a month of hosting fees is the kind of false economy that turns a routine migration into a rebuild from memory.

    The countdown clock in that welcome email is not a deadline for the migration. It is a deadline for the backup. Once the archive and the dump are sitting on two separate drives, with a successful test restore behind them, the clock stops mattering. The switch can happen on a Tuesday afternoon or a Sunday night, and the old host can delete whatever it likes.

    Related Posts

    Seven Web Analytics Mistakes Beginners Keep Making

    Nov 19, 2026

    Five Async Standup Mistakes That Quietly Kill Momentum

    Nov 18, 2026

    How to Choose a Web Host for Your First Site

    Nov 16, 2026

    Best Keyword Research Tools for Small Business Owners

    Nov 15, 2026

    The Project Management Software Checklist for Small Businesses

    Nov 14, 2026

    How to Choose a Payment Processor for Your Store

    Nov 13, 2026
    Top Posts

    Web Application Firewalls for Beginners: What You Need to Know

    Nov 12, 20267,713 Views

    Cheap Registration vs Premium Domains: What You Actually Get

    Nov 10, 20265,309 Views

    Pipeline Setup Mistakes That Quietly Cost You Deals

    Nov 9, 2026435 Views
    Don't Miss

    How to Build a Welcome Email Sequence That Converts

    Nov 8, 2026

    Most welcome sequences fail in the first ninety seconds, before a single subscriber reads past the subject line. The email arrives instantly.

    Domains vs Hosting: What's the Actual Difference?

    Nov 7, 2026

    Productivity Tools for Beginners Running a Side Business

    Nov 2, 2026

    Best DNS Security Services for Developers and Hosting Resellers

    Oct 31, 2026
    Latest Reviews
    8.9

    Best Website Builders for Small Agencies Juggling Clients

    Oct 30, 2026

    Choosing a Domain Registrar: A Beginner's Checklist

    Oct 28, 2026
    72

    Website Builder vs Custom Code: A Fair Fight

    Oct 27, 2026
    Most Popular

    Renewal Price Traps: Reading the Fine Print on Hosting

    Oct 25, 20267,713 Views

    How to Budget for SaaS Productivity Tools Per Employee

    Oct 21, 20265,309 Views

    How to Launch an Online Store in a Weekend

    Oct 18, 2026435 Views
    Our Picks

    CRM for Freelancers vs Small Agencies: Which Fits Your Workflow?

    Oct 14, 2026

    Cookie Consent Mistakes That Quietly Break Your Analytics

    Oct 11, 2026

    Stripe vs PayPal: Taking Client Payments as a Freelancer

    Oct 10, 2026

    Subscribe to Updates

    Get the latest creative news from FooBar about art, design and business.

    SmartMag DigiTech
    • Home
    • About Us
    • Contact Us
    • Privacy Policy
    • Affiliate Disclosure
    © 2026 ThemeSphere. Designed by ThemeSphere.

    Type above and press Enter to search. Press Esc to cancel.