[wp-testers] Attachment serialization and migration

Ryan Scheuermann ryan at concept64.com
Sat Feb 25 02:08:22 GMT 2006


You might be right, I didn't realize those numbers were the byte count.  
I did alter the directory structure, so the byte counts would be wrong.  
I'll try updating the byte counts and checking the results.  Thanks!

Ryan

----
Concept 64, Inc. | Phone: 610.349.0703 | Web: www.concept64.com



Andy Skelton wrote:
> On 2/24/06, Ryan Scheuermann <ryan at concept64.com> wrote:
>   
>> I exported the MySQL database as SQL, made the appropriate changes to
>> reflect the server name change and file structure changes. Etc etc.
>> Everything works, presto. Except for one thing: when the
>> inline-uploading.php is calling |get_post_meta| for the attachments -
>> the function |maybe_unserialize|) (calling PHP's |unserialize|) doesn't
>> unserialize the string of meta data in the DB as an array. It comes out
>> as a string and messes the inline uploading up.
>>
>> I figure this has something to do with how I export the SQL and then
>> reexecute the SQL statements on the server database. Is there some way I
>> can fix this without re-uploading every file through the inline
>> uploading form?
>>     
>
> I'm not positive but I can relate this to another situation where some
> characters had slashes added or removed prior to unserialize(), which
> changes the byte counts and causes unserialize() to fail. The only way
> I discovered that was by counting the bytes and comparing the result
> against the numbers in the serialized string.
>
> a:2:{i:0;s:5:"foo's";i:1;s:5:"bar's";}
> a:2:{i:0;s:6:"foo\'s";i:1;s:6:"bar\'s";}
>
> a:2:{i:0;s:6:"foo's";i:1;s:6:"bar's";}
> a:2:{i:0;s:5:"foo\'s";i:1;s:5:"bar\'s";}
>
> The first two are valid. The second two will fail to unserialize.
>
> It could be something else, but check for that.
>
> Andy
> _______________________________________________
> wp-testers mailing list
> wp-testers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-testers
>
>
>
>   


More information about the wp-testers mailing list