Mass photo import from Coppermine to WordPress

Tags:

Here's a bit of MySQL trickery to copy all the captions and descriptions from a CopperMine picture database into WordPress. This assumes that

update railpac.wp_posts wpp, railpac.wp_postmeta wp set wpp.post_content= (select caption from cpg133_pictures p where substring(wp.meta_value,length(wp.meta_value)-locate('/',reverse(wp.meta_value))+2) = p.filename) where wpp.id = wp.post_id and wp.meta_key='_wp_attached_file';