WordPress.org

Ready to get started?Download WordPress

Forums

Changing custom fields from a single install for media files (3 posts)

  1. AMEEKER
    Member
    Posted 1 year ago #

    This is the old site (www.stopcrime.org), on a different server, that was a single install. We're moving it into a multisite install on a different server.

    Here's the site on our multisite install: centraloh.yourcrimesite.com

    I think that my only remaining problem is with the images, and I have two issues.

    #1. All of the media files in the posts still have the old url's (ex: http://stopcrime.org/wp-content/uploads/2013/03/2013-Golf-Outing.jpg)

    Can I just run a search regex and replace "http://stopcrime.org/wp-content/uploads/" with "http://centraloh.yourcrimesite.com/files/" for existing media?

    And the second question is that the old theme used custom fields for featured images, but we obviously need to incorporate the built in featured image function, using the existing featured images. I have found the post meta manager plugin from Norcross that will allow me to swap out one post meta for another. Let's say the current post-meta is "entry-preview" what do I swap it out with? And I assume I have to do that AFTER I change the URL's above?

    yourcrimesite.com/wp-content/blogs.dir/49/files/2008/09/profile.jpg
    or
    http://centraloh.yourcrimesite.com/files/2008/09/profile.jpg

    both work, of course.

  2. Kim Parsell
    Volunteer Moderator
    Posted 1 year ago #

    1. Can I just run a search regex and replace "http://stopcrime.org/wp-content/uploads/" with "http://centraloh.yourcrimesite.com/files/" for existing media?

    Yes, that should work just fine. Change 1, then check the page to make sure the image is showing before going through them all.

    2. ... Let's say the current post-meta is "entry-preview", what do I swap it out with? And I assume I have to do that AFTER I change the URL's above?

    You would change entry-preview to _thumbnail_id and, yes, do this after changing the URLs. +1000 to using Norcross' Post Meta Manager plugin to accomplish this.

    Once again, change 1 of them, then check that your image is showing as the featured image in both the front-end and wp-admin.

  3. Nick Ciske
    Member
    Posted 1 year ago #

    1. Use a search/replace tool that supports serialized data or you may break your widgets and/or site!
    http://interconnectit.com/products/search-and-replace-for-wordpress-databases/

    2. As long as entry-preview stores the ID of the image in the media library, changing the meta key name will work. If it stores the URL, you'd have to do a lookup (ie query the media items for the one with that url) to get the ID and store that in _thumbnail_id. In that case you'd do that before the search and replace or you may not get the correct lookups.

Topic Closed

This topic has been closed to new replies.

About this Topic