[wp-testers] Attachment serialization and migration

Ryan Scheuermann ryan at concept64.com
Fri Feb 24 17:50:37 GMT 2006


I posted this in the support forums, but I thought it might be better 
suited here with a more technical and code-savvy audience.  And I'm not 
exactly sure it's not a bug in the code, or possibly a bug in the 
architecture. 

I've installed a local copy of WP v2.0.1 using XAMPP v1.4.16. I 
uploaded/attached multiple files using the inline uploading feature. The 
meta data is serialized and saved into the database fine. Everything 
works and unserializes perfect. Until I migrated my local copy to my 
server...

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 know my way around PHP and MySQL databases, and I understand object 
serialization. Where does the hangup occur between exporting the 
serialized data and importing the data. Or is there some other setting 
or DB option I'm missing? PHP isn't recognizing the data as 
serializable. Does this have something to do with it running on 
different versions/implementations of the PHP engine?

Please help. Thank you!

Ryan Scheuermann

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



More information about the wp-testers mailing list