WordPress.org

Ready to get started?Download WordPress

Forums

Just Custom Fields
Custom field image settings dissapear when migrating from dev to live s (2 posts)

  1. fuzzyjared
    Member
    Posted 1 year ago #

    When migrating sites between a dev url and a live custom field images or files are gone if you do a find and replace within the sql file.

    http://wordpress.org/extend/plugins/just-custom-fields/

  2. filippodrudi
    Member
    Posted 1 year ago #

    I had the same problem, I managed to figure out what's causing it and how to solve it.

    First of all, the values for your custom fields are store inside your wp_postmeta table, when you have an array as meta_value every string value is listed as the following:

    s:80:"http://www.mydomain.com/u/wp-content/uploads/2012/10/7897981874_2c580df195_z.jpg";

    I presume "s" stands for string, the number is the string length and the final value is your string, in this case an url.
    When you change the url in the string value, like so:

    s:80:"http://www.mynewdomain.com/u/wp-content/uploads/2012/10/7897981874_2c580df195_z.jpg";

    you end up changing the length of the string as well.
    The stated length (80) and the actual length of the string (83) don't match anymore and that's what's causing the problem here.

    You have to update the numerical value of every url you changed (inside wp_postmeta) in order to get your images and files back.
    Like so:

    s:83:"http://www.mynewdomain.com/u/wp-content/uploads/2012/10/7897981874_2c580df195_z.jpg";

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags