Skip to content

Migrate WordPress from SiteGround to cPanel: the full manual cutover

SiteGround dropped cPanel for Site Tools, so there is no backup WHM can restore. The three real export paths, the SG Optimizer cleanup, and the mail step everybody forgets.

Moving a WordPress site off SiteGround onto your own cPanel/WHM server is a manual job, and the reason is structural: SiteGround retired cPanel in favour of its own Site Tools panel. No cPanel-format account archive exists anywhere in your account, so WHM’s Transfer Tool has nothing to fetch and the “restore a full backup” path is simply unavailable. You have three real options — download the file and database backups Site Tools generates, use SSH with wp db export and tar if your plan includes shell access, or run a WordPress-level migration plugin — and after any of them you still rebuild the cPanel account, the mailboxes, the URLs in the database, and the certificate by hand. The part that goes wrong most often is not WordPress at all. It is email: SiteGround mailboxes travel with neither the files nor the database, and if MX moves before the cPanel mailboxes exist, inbound mail bounces.

What you’ll accomplish

  • A working copy of the site running on your cPanel account and verified against the real hostname before a single DNS record changes.
  • A database whose URLs and absolute filesystem paths point at the new server, with serialised data intact.
  • SiteGround’s platform hooks removed — the SG Optimizer plugin, its WP_CACHE constant, and the @include_once line SiteGround adds to wp-config.php.
  • Every mailbox re-created on cPanel and its history pulled down before MX moves, so no message is lost or bounced.
  • A valid AutoSSL certificate covering every hostname the site serves, plus a 72-hour verification pass.

Prerequisites

On the SiteGround side you need Site Tools access. Whether you also get SSH depends on the plan: shell access and WP-CLI are available on GrowBig and GoGeek, not on StartUp. Check before you plan the migration around commands you cannot run — the path you pick is decided by that one fact more than by anything else.

On the destination you need a cPanel account already created for the domain, a MySQL database and user, SSH access, and wp on the box. Two version checks matter before you copy anything. Read the PHP version the site actually runs on SiteGround and match it in MultiPHP Manager; a site on PHP 8.2 landing on an account defaulting to 7.4 fails in ways that look like a corrupt upload. Then compare database engines — SiteGround runs MySQL, your server may run MariaDB — because a dump from a newer server can carry a collation the older one refuses to parse.

Lower the TTL on the domain’s A and AAAA records to 300 seconds at least 24 hours ahead, early enough that the old TTL has expired everywhere. Lowering an 86400-second TTL two hours before the flip accomplishes nothing. This one step is what turns a bad cutover into a five-minute rollback.

Finally, open Site Tools and write down every mailbox and forwarder on the domain, noting which are real people and roughly how much mail each holds. You will need that list twice.

How it works

Every WordPress migration is the same three objects — files, database, and DNS — plus whatever the old host wrapped around them. SiteGround’s wrapper is thin, but the absence of cPanel changes the mechanics completely: there is no account archive, so nothing restores itself and each piece moves separately.

Decision diagram showing the three export paths off SiteGround — Site Tools backup, SSH with WP-CLI, or a migration plugin — and the manual work common to all of them

The three paths differ only in how bits leave SiteGround. Path A works on every plan and is the fallback when SSH is unavailable, at the cost of downloading and unpacking archives by hand. Path B is cleanest when your plan includes SSH: a WP-CLI dump plus a tar of wp-content is far smaller than a full account backup, and you control exactly what crosses. Path C — Duplicator, All-in-One WP Migration, and similar — needs neither SSH nor a panel backup, but runs inside PHP, so a large site can hit memory_limit or max_execution_time mid-export and leave you a truncated archive that looks complete.

Two SiteGround artefacts travel with the files whichever path you take, and both must go. The first is SG Optimizer (plugin slug sg-cachepress), which writes SiteGround-specific caching configuration and adds define('WP_CACHE', true); to wp-config.php. Off SiteGround it has no Memcached and no NGINX purge endpoint to talk to. The second is the line SiteGround injects near the top of wp-config.php:

@include_once('/var/lib/sec/wp-settings.php');

That path exists only on SiteGround servers. The @ suppresses the warning, so on a well-configured server it fails quietly — but with a different error configuration it prints a warning before headers are sent, which breaks logins and redirects. Delete the line.

Step-by-step

The order below is the point. Everything before the freeze is rehearsal you can repeat as often as you like; everything after it is live.

Two-lane cutover timeline showing the web lane and the mail lane in parallel from T-48 hours to T+72 hours, with the MX change deliberately last

  1. Inventory the site while it is still on SiteGround. If you have SSH:

    wp core version
    wp core verify-checksums
    wp plugin list --status=active --fields=name,version
    wp db size --tables --size_format=mb
    pwd

    Write down the core version; you will reinstall exactly that one. verify-checksums prints Success: WordPress installs verify against checksums. and anything it flags is a modified core file to account for. Note the pwd output — SiteGround home directories look like /home/customer/www/example.com/public_html, and that string is almost certainly stored in your database.

  2. Export the database. With SSH:

    wp db export sg-bulk.sql --add-drop-table

    Expect Success: Exported to 'sg-bulk.sql'. Without WP-CLI, use Site Tools’ PHPMyAdmin or the database backup download. Either way, run tail -3 sg-bulk.sql: it must end on a complete statement, not mid-INSERT. A truncated dump imports without complaint and silently loses the tail of your largest table.

  3. Package the files. From the site root over SSH:

    tar -czf ~/sg-files.tar.gz wp-content wp-config.php .htaccess

    Core files are not worth moving. tar prints nothing on success; ls -lh ~/sg-files.tar.gz should show a size close to the site’s reported disk usage. On Path A the Site Tools download replaces this step, on Path C the plugin’s archive does.

  4. Move the archive to the cPanel server. Pull from the destination, using the SSH port and user shown in Site Tools:

    scp -P 18765 SGUSER@SGHOST:sg-bulk.sql SGUSER@SGHOST:sg-files.tar.gz ~/

    scp prints a progress line per file ending at 100%. Run it as the cPanel account user, never as root.

  5. Rebuild the account and restore. Install WordPress core fresh, then unpack over it:

    cd ~/public_html
    wp core download --version=WPVERSION --skip-content
    tar -xzf ~/sg-files.tar.gz -C ~/public_html
    wp db import ~/sg-bulk.sql

    Substitute the version from step 1; --skip-content leaves wp-content to the tarball. Expect Success: WordPress downloaded. then Success: Imported from 'sg-bulk.sql'. Create the database and user in cPanel’s MySQL Database Wizard first and put those credentials in wp-config.php — the SiteGround ones will not work here.

  6. Strip the SiteGround pieces. Order matters: remove the plugin before you touch the constant it wrote.

    wp plugin deactivate sg-cachepress
    wp plugin delete sg-cachepress
    grep -n "WP_CACHE\|/var/lib/sec/" wp-config.php

    The plugin calls return Success: Deactivated 1 of 1 plugins. and Success: Deleted 1 of 1 plugins. The grep gives you the line numbers of define('WP_CACHE', true); and the @include_once line; delete both. Then confirm no drop-ins survived:

    ls -l wp-content/object-cache.php wp-content/advanced-cache.php

    No such file or directory for both is the answer you want. If either exists, move it aside: a leftover object cache pointing at a Memcached that is not on this server takes the site down rather than degrading quietly.

  7. Fix URLs and paths with wp search-replace, dry run first. The database holds the old domain if the domain is changing, and it holds the SiteGround absolute path from step 1:

    wp search-replace '/home/customer/www/example.com/public_html' '/home/CPUSER/public_html' --all-tables-with-prefix --dry-run --report-changed-only

    Read the counts and the closing Success: N replacements to be made line before committing, then run it for real and repeat the pair for any hostname change:

    wp search-replace '/home/customer/www/example.com/public_html' '/home/CPUSER/public_html' --all-tables-with-prefix --precise

    --all-tables-with-prefix catches tables a plugin created under your prefix that the default scan skips; --precise forces PHP-side serialisation handling instead of the faster SQL path, the right trade when options and widget data are serialised arrays. The WP-CLI search-replace reference documents every flag.

  8. Re-create the mailboxes now, not later. From the list you made in the prerequisites, create each address in cPanel’s Email Accounts screen with the same local part, plus the forwarders and autoresponders. Then pull each mailbox’s history down while SiteGround still holds it and MX still points there:

    imapsync --host1 SGMAILHOST --user1 you@example.com --password1 OLDPASS --host2 localhost --user2 you@example.com --password2 NEWPASS

    imapsync ends with a summary of messages transferred and Detected 0 errors. For a handful of mailboxes, connecting a desktop IMAP client to both accounts and dragging folders across works just as well.

  9. Get the certificate issued before the flip. AutoSSL validates domain control over HTTP — which cannot succeed until the domain resolves to the cPanel server — or over DNS, using a TXT record you can add while SiteGround still serves traffic. Use the DNS method to have the certificate ready in advance; cPanel’s documentation portal covers the DCV options. Then check coverage:

    uapi SSL installed_hosts | grep -i domains

    Apex, www, and every subdomain must appear. A certificate covering example.com but not www.example.com warns half your visitors.

  10. Freeze, sync the delta, then move DNS. Put the SiteGround site into maintenance mode so no order, comment, or form entry lands after your final export. Re-run steps 2 and 3, import, re-run the search-replace pair, then change the A and AAAA records. Move MX in the same pass only if the step 8 mailboxes are already populated; otherwise leave it another day.

  11. Regenerate permalinks and flush.

    wp rewrite flush --hard
    wp cache flush

    Expect Success: Rewrite rules flushed. and Success: The cache was flushed. The --hard form rewrites the WordPress block in .htaccess rather than only the database copy. That matters here: SiteGround serves rewrites through NGINX, so the .htaccess that came across may never have been authoritative.

Validate it works

Once DNS has settled, roughly an hour after the flip:

wp option get siteurl
wp option get home
wp db check
wp core verify-checksums

Both options must return the final domain, wp db check should report OK for every table, and checksums should verify. Then check from outside — put your twenty highest-traffic URLs in a file and sweep them:

while read u; do printf '%s ' "$u"; curl -o /dev/null -s -w '%{http_code}\n' "$u"; done < top-urls.txt

Every line should read 200, or 301 where you deliberately redirect. Then confirm resolution, TLS, and mail:

dig +short example.com @1.1.1.1
dig +short MX example.com
curl -sI https://example.com/ | head -1

The first must return the cPanel server’s IP from a public resolver, the second your intended mail host, and the third HTTP/2 200 or HTTP/1.1 200 OK with no certificate error. Finally send a real message to each mailbox and reply from it, and exercise site-sent mail too — a password reset, a contact form, and an order confirmation, not just one of the three. Then watch the error log and Search Console for 72 hours, which is where problems a smoke test cannot reach show themselves.

Troubleshooting

A Warning: include_once(/var/lib/sec/wp-settings.php) appears above the page, or logins silently fail. The SiteGround include from step 6 is still in wp-config.php, and output before headers breaks the Set-Cookie that logs you in. Delete the line.

Every page except the homepage returns 404. Rewrite rules are missing, because SiteGround handled them in NGINX and the .htaccess you copied was inert there. Run wp rewrite flush --hard, confirm the WordPress block reappears in ~/public_html/.htaccess, and check that the account allows overrides. The full diagnosis for post-migration permalink failures covers the rest.

Uploads return 403 and WordPress cannot write to wp-content. You unpacked the archive as root and the files now belong to root:

chown -R CPUSER:CPUSER ~/public_html
find ~/public_html -type d -exec chmod 755 {} \;
find ~/public_html -type f -exec chmod 644 {} \;

Mail bounces or vanishes after cutover. Two causes. If the mailboxes were not created before MX moved, mail arrives at a server with nowhere to put it. If MX still points somewhere external, cPanel treats a domain on its own account as a local mail exchanger and swallows the message — set it to Remote Mail Exchanger in Email Routing.

The import stops on an unknown collation. A dump from a newer MySQL carries a collation your destination does not know. Rewrite it before importing, then verify with a table count rather than a quiet exit:

sed -i 's/utf8mb4_0900_ai_ci/utf8mb4_unicode_ci/g' sg-bulk.sql

Serialised data is still broken after search-replace ran cleanly. The site uses a non-standard table prefix, or a plugin created tables the default scan does not walk. Re-run with --all-tables-with-prefix and --precise. Hand-written SQL UPDATE statements corrupt serialised arrays every time, because the length prefixes stop matching.

When this is the wrong approach

If you are leaving because the site felt slow and nobody wants to own performance, understand what you are giving up. SiteGround runs a full-page cache and Memcached above WordPress, and a theme that felt quick there was measured with PHP largely bypassed. On an unmanaged cPanel account that layer does not exist until you build it — LiteSpeed Cache on a LiteSpeed host, WP Super Cache or WP Rocket on Apache. Skip that and the site feels worse, not better.

If the domain’s mail is the business — a clinic, a law office, anywhere a lost message is a real problem — split the move. Migrate the website to cPanel and leave mail with an external provider, setting the domain to Remote Mail Exchanger. That removes the riskiest lane from the cutover entirely.

If your reason is genuinely control — a plugin the host disallows, a PHP extension they do not offer, other applications that need the same account — the move is justified, and the sequence above is your scope of work. The Kinsta version of this migration shows how much the details change between managed hosts.

Running WordPress that earns real money deserves an operator — Stack Harbor runs that stack under Enterprise WordPress; book an infrastructure consult.