Reputation: 33
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:
select * from wp_posts where post_type='attachment'
and all the wp_postmeta with those post_id's.wp_posts.ID
or wp_postmeta.meta_id
's conflicted with the new database, so I imported the SQL files. 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
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:
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
Reputation: 943
You do not need the export the wp_post data or wp_postmeta.
Here's how I migrate my websites manually:
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';
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');
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