• Resolved wilderbee

    (@wilderbee)


    Via these forums I am getting the idea that if I replace a certain number in the serialized database field: options, widget_text, I can recover functionality of my text widgets, as the website has moved to a new directory thus changing the path length.
    Two questions:

    (1) Which number(s) do I replace in the below serialized string to match the new path length? (and/or what else could I do?):

    a:5:{i:2;a:3:{s:5:”title”;s:0:””;s:4:”text”;s:996:”
    <div style= …text widget code…</div>
    “;s:6:”filter”;b:0;}s:12:”_multiwidget”;i:1;}

    (2) At the least, I can copy/paste the text/html code from this db field into a new widget so I don’t have to rebuild from scratch, which is great! However — before adding the rebuilt widgets — can I safely delete all data currently in Options, widget_text, considering it will never display and thus is worthless baggage? (A precautionary question – still kinda new in WP db).

    I did not know to backup text widgets to a notepad before moving!

    Thank you!

Viewing 1 replies (of 1 total)
  • Thread Starter wilderbee

    (@wilderbee)

    Next day, using phpMyAdmin, I saved all content of options, widget_text to a text file for safekeeping, then deleted all from options, widget_text.

    In WordPress, created some new text widgets by copying selected code from the text file I had just saved. Widgets worked great, no re-inventing code!

    Back at phpMyAdmin, examined the new options, widget_text.
    Compared the before and after serialization strings:
    Old: a:5:{i:2;a:3:{s:5:”title”;s:0:””;s:4:”text”;s:996:”
    New: a:3:{i:2;a:3:{s:5:”title”;s:0:””;s:4:”text”;s:974:”

    The closing string at the end remained the same:
    Old: “;s:6:”filter”;b:0;}s:12:”_multiwidget”;i:1;}
    New: “;s:6:”filter”;b:0;}s:12:”_multiwidget”;i:1;}

    Thus I may have been able to recover all original text widgets by copying original material back to options, widget_text, and then changing the first number in the a: string from 5 to 3. Or, it may be more complicated than that but the method might be worth a try for someone with dozens of text widgets to recover. Myself, not that many, so copy/paste looked like a quicker solution than more testing.

    Very Happy to recover the text-widget codes!!!
    Hope this helps someone else.

Viewing 1 replies (of 1 total)
  • The topic ‘example – fix which serialized number of text widget after moving site’ is closed to new replies.