• Resolved bratze49

    (@bratze49)


    Hello,

    after I moved a site with 2 Grid Galleries from one server to another, the Galleries are still there, the settings of each Gallery are the same…but they are empty.

    What could be the problem?

    Thanks ??

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter bratze49

    (@bratze49)

    I found the error. It was a serialized string!
    Fixed it with this code:

    preg_match_all(‘#s:([0-9]+):”([^;]+)”#’,$string,$m);
    foreach($m[1] as $k => $len) {
    if($len != strlen($m[2][$k])) {
    $newstr=’s:’.strlen($m[2][$k]).’:”‘.$m[2][$k].'”‘;
    echo “len mismatch: {$m[0][$k]}\n”;
    echo “should be: $newstr\n\n”;
    $string= str_replace($m[0][$k], $newstr, $string);
    }
    }

    found on https://stackoverflow.com/questions/15138893/fix-serialized-data-broken-due-to-editing-mysql-database-in-a-text-editor, slightly changed it.

    Plugin Author rameez_iqbal

    (@rameez_iqbal)

    Hi, Sorry for being late on this.

    Is it fixed now or do you need more help?

    Regards

    Thread Starter bratze49

    (@bratze49)

    It is fixed now. Thank you for you answer.

    Your Plugin is great!

    • This reply was modified 7 years, 5 months ago by bratze49.

    Having the same issue, what did you edit and where? Thanks!

    Thread Starter bratze49

    (@bratze49)

    I have searched in the database for “fgg_images”. It was found in 2 places, because I have 2 galleries.

    The field “meta_value” contains serialized data, and after moving the site some values are wrong (because they did not change).

    I saved the content of a meta_valiue field in the variable $string, then I ran the above script. Like this:

    <?php
    $string = “old_wrong_data”;

    preg_match_all(‘#s:([0-9]+):”([^;]+)”#’,$string,$m);
    foreach($m[1] as $k => $len) {
    if($len != strlen($m[2][$k])) {
    $newstr=’s:’.strlen($m[2][$k]).’:”‘.$m[2][$k].’”‘;
    echo “len mismatch: {$m[0][$k]}\n”;
    echo “should be: $newstr\n\n”;
    $string= str_replace($m[0][$k], $newstr, $string);
    }
    }

    echo “<br>———“;
    echo $string // good new data
    ?>

    The output of this (below the ———) I pasted back into the mata_value box. i did this 2 times, once for each gallery.

    Good Luck

    Thanks. I figured it out, sort of… I added

    
    define( 'AUTOSAVE_INTERVAL', 300 );
    define( 'WP_POST_REVISIONS', 5 );
    define( 'EMPTY_TRASH_DAYS', 7 );
    define( 'WP_CRON_LOCK_TIMEOUT', 120 );
    

    To my wp-config.php and it popped back in. Not sure exactly why but it works?

    Thread Starter bratze49

    (@bratze49)

    You must have had a commpletely different error with the same results then ??

    Thread Starter bratze49

    (@bratze49)

    Resolved

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘After moving the site all galleries are empty’ is closed to new replies.