Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
VGSources
Blog

Can’t Access Your WordPress Site After Cloning a VPS Snapshot? A Safe Recovery Runbook

A VPS clone can preserve the old domain, database credentials and server assumptions. Follow this ordered runbook to restore DNS routing, WordPress URLs, database access, permissions, permalinks and HTTPS without losing your rollback.
Length10 min Posted Quest giverVGSources Team

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A VPS snapshot clone usually fails for a predictable reason: it copied the original server’s files, database, domain settings and credentials, but the new server is not yet serving the requested hostname in the same way. Start at the network edge, then verify the web server, database, WordPress URLs, permissions, rewrites and HTTPS in that order. Fixing WordPress before the domain reaches the clone can make a correct repair appear ineffective.

Keep the original snapshot and an off-site database backup untouched while you work. Do not delete the source instance or overwrite the only rollback point until the clone passes front-end, login, media-upload, permalink and scheduled-task checks.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What a VPS clone preserves—and why access breaks

A snapshot normally reproduces the operating system, web-server configuration, WordPress files and database. It can therefore reproduce assumptions that were valid only on the original server: the old public IP, a particular virtual host, the old domain in wp_options, source-server database credentials, restrictive file ownership, an expired certificate and rewrite rules tied to a previous document root.

The symptom tells you which layer to inspect, but not always where the fault began. A redirect to the old site points toward DNS, virtual-host or WordPress URL settings. “Error establishing a database connection” points to wp-config.php or the database service. A working homepage with 404s on every internal link usually indicates rewrite or permalink configuration. A 403, blank response or failed upload commonly indicates ownership, mode or web-server access.

#1 Best Overall
Seagate 2TB Portable Hard Drive | USB 3.0 (STGX2000400) | Everyday HDD storage. Plug-and-play backup. Windows & macOS. Adobe CC trial included. 1-Year Warranty
  • Easily store and access 2TB to content on the go with the Seagate Portable Drive, a USB external hard drive
  • Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
  • To get set up, connect the portable hard drive to a computer for automatic recognition no software required
  • This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
  • The available storage capacity may vary.

Run this triage sequence before changing data

  1. Confirm the hostname resolves to the clone’s public IPv4 and IPv6 addresses, if an AAAA record is published.
  2. Confirm the clone’s Apache virtual host or Nginx server block matches that hostname and points to the intended WordPress document root.
  3. Check that the document root contains the expected wp-admin, wp-includes, wp-content and wp-config.php files.
  4. Check database credentials and connectivity.
  5. Correct WordPress’s siteurl and home values if the domain, scheme or path changed.
  6. Perform a serialization-aware URL replacement only after the canonical URL is decided.
  7. Repair ownership, permissions and rewrite rules.
  8. Validate HTTPS and purge caches only after requests are reaching the clone.

Capture the exact browser error, HTTP status, resolved IP and relevant web-server and PHP-FPM log lines as you go. A timestamped record makes it easier to distinguish a new failure from a cached response.

1. Prove DNS and virtual-host routing

Check the public DNS records

Query the domain’s A and AAAA records from a machine outside the VPS network. The returned address must be the clone’s public address. An old A record, an overlooked AAAA record or a DNS provider’s proxy can send some visitors to the source server while others reach the clone.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Lowering a DNS record’s TTL does not instantly remove answers that recursive resolvers already cached. During a migration, test from more than one network and note the resolver and answer you used. If you changed nameservers, allow for nameserver propagation rather than repeatedly editing WordPress.

Check the web server’s host match

On the clone, inspect enabled Apache virtual hosts or Nginx server blocks. The requested hostname must appear in the server’s ServerName/ServerAlias or server_name, and the configured document root must be the directory containing the intended WordPress files. A default site can otherwise answer with a welcome page, another application or a 404 even when DNS is correct.

Request the site locally while supplying the real host header. For example, substitute the clone’s loopback address and hostname in a command such as curl -I --resolve example.com:80:127.0.0.1 http://example.com/. The status and Location header reveal whether the clone itself is redirecting you. Repeat on port 443 after TLS is configured.

Distinguish a clone response from a cached response

Compare response headers, a temporary diagnostic header configured on the clone, or the server logs with the browser result. If the logs show no request at the time of testing, the request is still going elsewhere or a cache is answering it. Do not debug database values until you have evidence that the clone receives the request.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

2. Fix “Error establishing a database connection”

Verify every database setting

Open the clone’s wp-config.php and check these values against the database actually restored on the clone:

  • DB_NAME: the restored database name.
  • DB_USER: a database account present on the clone.
  • DB_PASSWORD: the password for that account, including any special characters exactly as configured.
  • DB_HOST: the correct host and, when required, port or socket.
  • $table_prefix: the prefix used by the restored tables, such as wp_ or a custom prefix.

A snapshot can contain a configuration that still points to a source-server database address or a user permitted only from the source host. The database service must be running, listening on the expected interface and allowing the cloned user to connect from the web server’s address. Test with the database client using the same host, user and database named in wp-config.php; a successful login isolates WordPress from a service or grant problem.

Rank #2
Seagate Portable 5TB External Hard Drive HDD – USB 3.0 for PC, Mac, PS4, & Xbox - 1-Year Rescue Service (STGX5000400), Black
  • Easily store and access 5TB of content on the go with the Seagate portable drive, a USB external hard Drive
  • Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
  • To get set up, connect the portable hard drive to a computer for automatic recognition software required
  • This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
  • The available storage capacity may vary.

Read the logs instead of guessing

Web-server and PHP-FPM logs commonly distinguish “access denied for user,” “unknown database,” connection refusal and socket errors. Check the database service status and its error log, then check PHP-FPM and the web-server error log at the same timestamp. If the account exists but lacks privileges on the restored database, grant only the required database access and retry; do not replace credentials in multiple files without recording which value is authoritative.

3. Set the clone’s canonical WordPress URL

WordPress stores the base URL in the wp_options table. The option names are siteurl (where WordPress core is installed) and home (the public address visitors use). The values must include the scheme, normally https://, and must not end with a slash. If the installation lives in a subdirectory, include that path consistently.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Preferred method with WP-CLI

From the WordPress directory, run the commands with the clone’s administrator or system account:

wp option update siteurl 'https://example.com'
wp option update home 'https://example.com'

Use the actual table prefix and path if your installation differs. If the dashboard is inaccessible but the database is available, these commands still work when WP-CLI can load the site.

Temporary constants when WordPress cannot load

Add these definitions above the line that says WordPress should stop editing the configuration file:

define('WP_HOME', 'https://example.com');
define('WP_SITEURL', 'https://example.com');

They override the database values long enough to regain access. Once the database options are corrected, remove the temporary definitions so there is one clear source of truth. Leaving them in place can make later URL changes appear to have no effect.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Direct SQL as a recovery fallback

When WP-CLI is unavailable, update only the two option rows in the correct options table. First identify the table from $table_prefix; it may not be wp_options. A typical query is:

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

Take a database backup before running SQL and verify the selected table and values afterward. A mistaken prefix or database can modify the wrong site.

Rank #3
Seagate Portable 1TB External Hard Drive HDD – USB 3.0 for PC, Mac, PlayStation, & Xbox, 1-Year Rescue Service (STGX1000400) , Black
  • Easily store and access 1TB to content on the go with the Seagate Portable Drive, a USB external hard drive.Specific uses: Personal
  • Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop. Reformatting may be required for Mac
  • To get set up, connect the portable hard drive to a computer for automatic recognition no software required
  • This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
  • The available storage capacity may vary.

4. Replace old-domain references without corrupting data

Changing siteurl and home does not update every stored link. Old addresses can remain in post content, widgets, theme settings, plugin configuration and attachment metadata, producing mixed-content warnings, missing styles or links back to the source domain.

Use a serialization-aware replacement

WP-CLI’s search-and-replace command understands serialized PHP data, so lengths inside serialized strings are adjusted safely:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
wp search-replace 'https://old.example' 'https://example.com' --all-tables --skip-columns=guid --dry-run
wp search-replace 'https://old.example' 'https://example.com' --all-tables --skip-columns=guid

Run the dry run first and review the table and column counts. Include the old scheme and, where necessary, an old subdirectory variant as separate replacements. Keep the replacement limited to the intended database and take a fresh backup before the live run.

Never rewrite post GUIDs

Post GUID values are identifiers, not display URLs. Changing them can interfere with feeds and migration history without fixing a visitor-facing link. Exclude the guid columns as shown above. Do not use an unqualified global text replacement on a database containing serialized values; it can make widgets, plugin settings or theme options unreadable.

5. Repair 403 errors, blank responses and failed writes

Check ownership and directory traversal

The user running the web server or PHP-FPM must be able to traverse the document-root directories and read WordPress files. It must also be able to write to the directories that genuinely require writes, especially wp-content/uploads and any update or cache directory used by your configuration.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Inspect ownership and modes on the document root, every parent directory, wp-content and uploads. A file accidentally left at mode 0000 is unreadable; normal web files are commonly 0644, while directories commonly need execute permission for traversal. The correct owner and group depend on your distribution and PHP-FPM setup, so identify the configured service account instead of blindly assigning a named user.

Avoid dangerous blanket permission fixes

Do not make the entire site world-writable and do not recursively apply one mode to files and directories. That can expose configuration secrets and create a larger security problem. Correct the specific paths, restore the expected owner, and review security-module denials such as SELinux or AppArmor when Unix permissions look correct.

6. Restore permalinks and rewrite rules

If the homepage loads but posts, pages or feeds return 404, the PHP application may be healthy while the web server is not forwarding “pretty” URLs to index.php.

Rank #4
Seagate Portable 4TB External Hard Drive HDD – USB 3.0, 1-Year Rescue | Everyday HDD storage. Plug-and-play backup. Windows & macOS. Adobe CC trial included. 1-Year Warranty
  • Easily store and access 4TB of content on the go with the Seagate Portable Drive, a USB external hard drive.Specific uses: Personal
  • Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
  • To get set up, connect the portable hard drive to a computer for automatic recognition no software required
  • This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
  • The available storage capacity may vary.

Apache

Confirm that the site’s .htaccess file exists in the document root, that overrides are permitted for that directory and that the rewrite module is enabled. The file must contain the WordPress rewrite block appropriate to the installation. Check the Apache error log for denied overrides or rewrite syntax errors.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Nginx

Nginx does not read .htaccess. Its server block needs a location rule that falls back to /index.php?$args for requests that are not real files or directories. Validate the configuration before reloading the service; a syntax error can take the whole site offline.

Resave permalinks

After the canonical URL, document root and rewrite configuration are correct, open WordPress at Settings > Permalinks and click Save Changes without changing the structure. This regenerates the rewrite rules. With shell access, the equivalent WP-CLI action is:

wp rewrite flush

Use a hard flush only when you understand how your server stores rules; the web-server configuration still has to be correct.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

7. Correct HTTPS, redirects and caches

The clone needs a certificate whose names cover the hostname visitors request. A certificate for the old domain, an HTTP-to-HTTPS rule that points to the old host, or a forced scheme mismatch can create redirect loops and browser warnings. Check the complete redirect chain with a header-only request and inspect every Location value.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Update hard-coded HTTP references only after deciding whether the site should be HTTPS-only. Then clear page-cache, object-cache, CDN and browser-cache entries. Purging too early can preserve a redirect generated by the old server and hide a correct clone configuration. If the clone’s logs show the request and the response is still stale, purge the layer that supplied that response rather than repeatedly editing WordPress.

Match the symptom to the likely layer

Symptom Highest-value checks Typical corrective action
Redirects to the old domain DNS answer, virtual host, home/siteurl, redirect headers and cached responses Point DNS to the clone, select the correct host block, update both URL options and purge stale redirects.
“Error establishing a database connection” DB_* values, database service status, user grants and database error log Restore the correct database name, credentials, host and permissions; start or reconfigure the database service if required.
Homepage works; internal links are 404 Document root, Apache rewrite or Nginx fallback, .htaccess and permalink settings Fix the rewrite configuration and resave permalinks.
403 Forbidden File modes, owner/group, parent-directory traversal, web-server rules and security-module logs Restore least-privilege ownership and permissions and remove the rule denying the requested path.
Blank page or PHP error PHP-FPM log, PHP version/extensions, plugin and theme errors Read the fatal error, restore required extensions or temporarily disable the offending component while preserving a backup.
Uploads or updates fail wp-content/uploads ownership, free disk space, PHP limits and write restrictions Give the service account write access only where needed and correct resource or policy limits.

Test the clone before switching traffic permanently

Use a temporary hosts-file entry or an equivalent private DNS name to test the clone while public DNS still points to the source. The hostname in the test must match the certificate and virtual-host configuration; testing by bare IP can select the wrong site and produce a misleading TLS or redirect result.

  • Load the home page and several posts or pages.
  • Sign in and sign out from a private browser window.
  • Upload an image, view it in the Media Library and confirm its public URL.
  • Open category, tag, search, feed and paginated URLs.
  • Submit a form or other application-specific action that writes to the database.
  • Run scheduled tasks and confirm cron jobs use the clone’s paths and environment.
  • Check that HTTPS has no certificate, mixed-content or redirect-loop warning.
  • Compare response status codes and review logs for new PHP, database or permission errors.

When to roll back or ask for help

Stop making changes if you cannot identify which database, document root or snapshot you are editing. Restore the last known-good snapshot or database backup rather than layering uncertain SQL and permission changes. Keep a copy of the failed state and its logs; they can show whether the fault was DNS, routing, application configuration or data.

Escalate with the exact hostname, clone IP, DNS answers, HTTP status and redirect chain, WordPress and PHP versions, database error text, relevant web-server/PHP-FPM log lines and the changes already made. WordPress Site Health can export details about the WordPress version, PHP and server environment, database, active plugins and themes, and filesystem permissions. Remove passwords, API keys and other secrets before sharing any configuration or log file.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Quick Recap

Bestseller No. 1
Seagate 2TB Portable Hard Drive | USB 3.0 (STGX2000400) | Everyday HDD storage. Plug-and-play backup. Windows & macOS. Adobe CC trial included. 1-Year Warranty
Seagate 2TB Portable Hard Drive | USB 3.0 (STGX2000400) | Everyday HDD storage. Plug-and-play backup. Windows & macOS. Adobe CC trial included. 1-Year Warranty
This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable; The available storage capacity may vary.
$129.99
Bestseller No. 2
Seagate Portable 5TB External Hard Drive HDD – USB 3.0 for PC, Mac, PS4, & Xbox - 1-Year Rescue Service (STGX5000400), Black
Seagate Portable 5TB External Hard Drive HDD – USB 3.0 for PC, Mac, PS4, & Xbox - 1-Year Rescue Service (STGX5000400), Black
This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable; The available storage capacity may vary.
$219.99
Bestseller No. 3
Seagate Portable 1TB External Hard Drive HDD – USB 3.0 for PC, Mac, PlayStation, & Xbox, 1-Year Rescue Service (STGX1000400) , Black
Seagate Portable 1TB External Hard Drive HDD – USB 3.0 for PC, Mac, PlayStation, & Xbox, 1-Year Rescue Service (STGX1000400) , Black
This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable; The available storage capacity may vary.
$119.80
Bestseller No. 4
Seagate Portable 4TB External Hard Drive HDD – USB 3.0, 1-Year Rescue | Everyday HDD storage. Plug-and-play backup. Windows & macOS. Adobe CC trial included. 1-Year Warranty
Seagate Portable 4TB External Hard Drive HDD – USB 3.0, 1-Year Rescue | Everyday HDD storage. Plug-and-play backup. Windows & macOS. Adobe CC trial included. 1-Year Warranty
This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable; The available storage capacity may vary.
$189.99

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More quests from Patch Notes

  1. How to Set Up a RedM (RDR2) Server in 2026: License Key, txAdmin and server.cfg, Step by StepBlog11min
  2. Best RedM (RDR2) Server Hosting in 2026: Comparing Four Hosts on Slots, Memory and PriceBlog10min
  3. How to Host a Mindustry Server in 2026: server-release.jar, Port 6567 and the Commands That MatterBlog7min
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.