Title: WordPress Migration Lost Galleries
Last modified: August 20, 2016

---

# WordPress Migration Lost Galleries

 *  [thebryceisrite08](https://wordpress.org/support/users/thebryceisrite08/)
 * (@thebryceisrite08)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/wordpress-migration-lost-galleries/)
 * I recently migrated my site to a new domain. I exported a sql database of blog
   posts from the old site and imported them to the new site through phpmyadmin.
   Now, the posts are all showing up but the images for each post are not.
 * On my server all the images are stored in /wp-content/uploads, however they don’t
   exist on the media page. I don’t know how to move those all into the media section
   or if i even need to since they are on the server…
 * I checked my sql database file, to change the urls and noticed that the galleries
   don’t show urls to the images but rather say [gallery-link =”file”] or something
   along those lines. I have no idea what that means or how the database would even
   link to the gallery without some sort of descriptor.
 * So, bottom line is, i got my million posts migrated over to the new site, but
   none of the images. Changed all the urls that needed to be changed, but galleries
   are not working…

Viewing 15 replies - 1 through 15 (of 26 total)

1 [2](https://wordpress.org/support/topic/wordpress-migration-lost-galleries/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/wordpress-migration-lost-galleries/page/2/?output_format=md)

 *  [Pioneer Web Design](https://wordpress.org/support/users/swansonphotos/)
 * (@swansonphotos)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/wordpress-migration-lost-galleries/#post-2985735)
 * They exist in the files. The db points to the files. Download old media files
   from old site and upload to new.
 *  [Chris Olbekson](https://wordpress.org/support/users/c3mdigital/)
 * (@c3mdigital)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/wordpress-migration-lost-galleries/#post-2985736)
 * The gallery shortcode uses the wp_post_meta table in the database to get the 
   images attached to the post. When an image is attached to the post using the 
   media uploader 4 things happen.
 * 1. An attachment post_type entry is created in the wp_posts table and the ID 
   of the actual post is assigned to the post_parent column.
 * 2. A post_meta entry is made using the post id of the attachment with the meta_key
   _wp_attached_file. The value contains the img url relative to directory set in
   media options ( usually wp-content/uploads ).
 * 3. Another post_meta entry is made using the post id of the attachment with the
   meta_key _wp_attachment_metadata. This contains a serialized array containing
   the file src, width, and height of each image size along with camera exif metadata.
 * 4. A post_meta entry using the POST ID OF THE ACTUAL POST with the meta_key _thumbnail_id
   which references the post id of the attachment.
 * You stated that “I exported a sql database of blog posts from the old site and
   imported them to the new site through phpmyadmin” Did you export and import the
   entire database or just the blog posts? If it was just the blog posts you will
   also need to export and import the wp_post_meta table and it would probably be
   a good idea to also import the wp_terms, wp_term_taxonomy, and wp_term_relationship
   tables as well.
 *  [Pioneer Web Design](https://wordpress.org/support/users/swansonphotos/)
 * (@swansonphotos)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/wordpress-migration-lost-galleries/#post-2985737)
 * It may be more helpful to to point out the obvious?
 *  Thread Starter [thebryceisrite08](https://wordpress.org/support/users/thebryceisrite08/)
 * (@thebryceisrite08)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/wordpress-migration-lost-galleries/#post-2985738)
 * I exported the entire database for the blog, changed the urls to point to the
   new domain, and uploaded all of the content to the new site.
 * Some images work, but the galleries do not.
 *  Thread Starter [thebryceisrite08](https://wordpress.org/support/users/thebryceisrite08/)
 * (@thebryceisrite08)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/wordpress-migration-lost-galleries/#post-2985739)
 * Yea, i get the basics of it. And for the most part, everything worked fine. It
   was just the gallery images do not display, and my images which are uploaded 
   to the server do not show up in the media section of the admin page.
 *  [Pioneer Web Design](https://wordpress.org/support/users/swansonphotos/)
 * (@swansonphotos)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/wordpress-migration-lost-galleries/#post-2985741)
 * You exported only the images in the library, upload the rest, issue over…_this
   issue is both well known and understood by most_.
 *  Thread Starter [thebryceisrite08](https://wordpress.org/support/users/thebryceisrite08/)
 * (@thebryceisrite08)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/wordpress-migration-lost-galleries/#post-2985742)
 * Ok, thanks for your help, but no need to be condescending.
 * So, in addition to uploading all the images to the server, I must also import
   them into the Media Section of wordpress? If so, i haven’t done that.
 *  Thread Starter [thebryceisrite08](https://wordpress.org/support/users/thebryceisrite08/)
 * (@thebryceisrite08)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/wordpress-migration-lost-galleries/#post-2985744)
 * additionally, there is not a single wordpress migration tutorial that asks you
   to do that.
 *  [Pioneer Web Design](https://wordpress.org/support/users/swansonphotos/)
 * (@swansonphotos)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/wordpress-migration-lost-galleries/#post-2985829)
 * > not a single wordpress migration tutorial
 * Condescending? Your desire is to learn? I wish you the best.
 * [http://codex.wordpress.org/Troubleshooting](http://codex.wordpress.org/Troubleshooting)
 * If you post the URL (per forum rules for best support), I believe it likely you
   have post or page embedded images and they are not in the Media Library (but **
   _ARE_** files that can be uploaded and that will fix the issue – takes a few 
   minutes)
    Please share this as a tutorial.
 *  Thread Starter [thebryceisrite08](https://wordpress.org/support/users/thebryceisrite08/)
 * (@thebryceisrite08)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/wordpress-migration-lost-galleries/#post-2985830)
 * Ok. So I have exported my database in its entirety using phpmyadmin.
 * Do I also have to export from wordpress itself?
 *  [Pioneer Web Design](https://wordpress.org/support/users/swansonphotos/)
 * (@swansonphotos)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/wordpress-migration-lost-galleries/#post-2985831)
 * You need to download any images linked at old site and upload to new site _with
   same folder structure_.
 *  [WP SITES](https://wordpress.org/support/users/wordpresssites/)
 * (@wordpresssites)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/wordpress-migration-lost-galleries/#post-2985832)
 * You should change the site address in WordPress general settings before you export
   the database.
 * WordPress Address (URL)
    Site Address (URL)
 * Otherwise, you’ll need to use the search and replace or velvet blues plugin to
   change the url’s to your images
 *  Thread Starter [thebryceisrite08](https://wordpress.org/support/users/thebryceisrite08/)
 * (@thebryceisrite08)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/wordpress-migration-lost-galleries/#post-2985833)
 * So this is the problem here. I copied from my database, a post entry. You’ll 
   notice that in place of a path to the image, is something that says [gallery 
   link="file"]. These posts don’t show the image.
 * Example not working:
 * (2320, 1, ‘2012-08-21 03:12:00’, ‘2012-08-21 03:12:00’, ‘[gallery link="file"
   order="DESC"]\r\n\r\nYesterday was the one-day set of Method”s two story, 1,400
   square foot custom home located on Bainbridge Island. The three bedroom, two 
   bath home designed by Group Architect utilizes sustainable systems and construction
   techniques, including Henry Blueskin wrap with a Method-designed pressure treated
   plywood rain screen, a Daikin altherma air to water heat pump, electric heated
   floors, Taylor metal roofing, prewiring for solar power, and low VOC paints, 
   finishes, and adhesives.’, ‘Custom Bainbridge Prefab Set’, ”, ‘publish’, ‘open’,‘
   open’, ”, ‘custom-bainbridge-prefab-set’, ”, ”, ‘2012-08-21 04:25:19’, ‘2012-
   08-21 04:25:19’, ”, 0, ‘[http://www.XXXXXXX.com/?p=2320&#8217](http://www.XXXXXXX.com/?p=2320&#8217);,
   0, ‘post’, ”, 0),
 *  Thread Starter [thebryceisrite08](https://wordpress.org/support/users/thebryceisrite08/)
 * (@thebryceisrite08)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/wordpress-migration-lost-galleries/#post-2985834)
 * one thing i noticed is that the permalink for some posts in the database are 
   different from the permalink shown in the edit page area.
 * This shows up in wordpress
 * [http://XXXXX.net/?p=2300](http://XXXXX.net/?p=2300)
 * This shows up in my database…
 * [http://XXXXX.net/?p=2424](http://XXXXX.net/?p=2424)
 *  Thread Starter [thebryceisrite08](https://wordpress.org/support/users/thebryceisrite08/)
 * (@thebryceisrite08)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/wordpress-migration-lost-galleries/#post-2985835)
 * changing those to match did nothing…. at a loss here. Pretty sure its the fact
   that some of these posts have a [gallery link="file'] tag and thus do not work…

Viewing 15 replies - 1 through 15 (of 26 total)

1 [2](https://wordpress.org/support/topic/wordpress-migration-lost-galleries/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/wordpress-migration-lost-galleries/page/2/?output_format=md)

The topic ‘WordPress Migration Lost Galleries’ is closed to new replies.

## Tags

 * [database](https://wordpress.org/support/topic-tag/database/)
 * [galleries](https://wordpress.org/support/topic-tag/galleries/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 26 replies
 * 6 participants
 * Last reply from: [JasonSizzle](https://wordpress.org/support/users/jasonsizzle/)
 * Last activity: [13 years, 4 months ago](https://wordpress.org/support/topic/wordpress-migration-lost-galleries/page/2/#post-2985892)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
