Innovate | Connect | Transform
ContactService statusUSD $

GICT knowledge base

Fix Missing WordPress Images After a Migration Safely

Published

MigrationWordPresscPanelphpMyAdmin

Missing images after a WordPress migration can come from missing files, old URLs, permissions, HTTPS problems or stale caches. Diagnose the failing request before changing the database. One SQL replacement does not fix every image and can damage serialized settings if used indiscriminately.

Inspect a failing image URL

Open a representative failing image from the browser and record its hostname, path and response. Check whether the corresponding upload file exists on the intended destination, whether permissions allow access, and whether the image is requested over the correct HTTPS hostname. Also inspect srcset variants, CSS background images and any CDN URLs.

If files were never copied, recover them from a verified backup. If a CDN or cache serves stale markup, correct that configuration. A database search-replace cannot reconstruct a missing file or repair a wrong web-server mapping.

Back up before replacing an old hostname

When the problem is a confirmed old site URL in stored content, preserve a database backup and rollback access first. Use a serialization-aware WordPress migration tool rather than the former blanket SQL query. The actual table prefix is installation-specific; the old “wp-posts” table label was also incorrect.

For a standard single-site installation with WP-CLI available, run the following dry preview from the intended WordPress directory, replacing both example origins. Default scope is the tables registered with this installation; plugin-specific tables may need a separately reviewed scope.

wp search-replace 'https://old.example' 'https://new.example' \
  --skip-columns=guid --dry-run

Review the reported tables and replacements. The official command handles PHP serialized data; --dry-run previews database changes. Do not use --all-tables against a shared database or extend this example to multisite without an installation-specific plan.

Only after verifying the scope, backup and replacement pair should you repeat the reviewed command without --dry-run. That writes to the database. Keep GUID values unchanged for an existing site’s move. Separately update legitimate hardcoded theme/configuration URLs through their supported settings.

Check the result before removing the source

Clear the appropriate application/CDN caches, then test representative posts, galleries, responsive image sizes and background images. Confirm that the browser is loading the intended destination’s files rather than hotlinking the old service. Test important application functions as well, and retain rollback material until accepted.

Reference: WP-CLI search-replace documentation. Reviewed October 14, 2026. Command definitions were checked; this editorial review did not run a URL replacement on a customer database.

Related guides

Account services are unavailable until the production backend is configured.