I came to wonder why drupal serializes data?
What is the benefit?

And then, I need to search & replace values in a SQL file using serialized data.

Is there any faster way than editing every separate serialized subrecord?

Before deciding to serialize people should first think about the problems it creates and provide means to search & replace in the database.

Comments

fkelly12054@gmail.com’s picture

I'm not a drupal developer and I've stared at some of the serialized data too. I suspect that the answer to your question is that the core folks don't want you editing serialized data by hand. There are undoubtedly core functions (or objects) that unpack the serialized data into arrays (all the info to do that is right in the data) and then repack and store any changes. The core folks want you to use the standard Drupal API to make these changes because doing it by hand can destroy your database or site and it's way too easy to make mistakes.

DrupalDope’s picture

that's a negative.

DrupalDope’s picture

fortunately, there is a handy tool to search & replace serialized database date:
https://interconnectit.com/products/search-and-replace-for-wordpress-dat...

it's labeled for use with wordpress, but I use it for drupal too.

although, there are some strange errors occuring, for some reason it doesn't work on some tables. oh well. works for most. did the job I needed.