ZRM
ZRM

Reputation: 33

Getting WordPress images into the Media Library after migration

I am moving from one WordPress host to another. I'm stuck at getting migrated images to show up in the media library.

This is what I did:

The data is in the tables, but still nothing is showing up in the media library. The date filter drop down list in the Media Library is showing all the months for the folders, but it's not showing any images "No Media Files Found".

The images are in the right place, since the page builder I'm using is showing all the images properly (with the new domain name in their URLs).

Is there an extra step I'm missing to get the images on the new server to show up in the media library?

Upvotes: 1

Views: 4319

Answers (2)

xDiff
xDiff

Reputation: 731

The easiest way to migrate to another host and keep the links and images intact is to use the plugin called All in One WP Migration

The Step to follow is:

  1. Install the plugin on your website
  2. Create a backup, the result will be .wpress, download it
  3. In the new host, install a clean copy of WP
  4. Install the plugin on this new website
  5. Import the .wpress backup

This will tell you that all data of your new installation will be replaced by the one from your previous host but all links will be updated. So old-domain.com will be replaced by new-domain.com without making changes anywhere (database or content).

Tested this many times so I know it works well. There is a reason why it has 1+M downloads.

Upvotes: 0

Mel
Mel

Reputation: 943

You do not need the export the wp_post data or wp_postmeta.

Here's how I migrate my websites manually:

  1. Export the whole database and download the files.
  2. Import the whole database and copy the files on the root folder.
  3. Then on your phpmyadmin and run these scripts, select wp_options table:

    UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldurl', 'http://www.newurl') WHERE option_name = 'home' OR option_name = 'siteurl';

    1. On the wp_posts table run these:

    UPDATE wp_posts SET guid = replace(guid, 'http://www.oldurl','http://www.newurl');

    UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldurl', 'http://www.newurl');

    1. On wp_postmeta table run this:

    UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.oldurl','http://www.newurl');

Make sure to change the urls. This will fix the images and other media that are not showing because the url is broken or your site is showing the old url.

Upvotes: 1

Related Questions