1

I'm attempting to migrate data that is using a plugin (WordPress Job Board) to a new instance of a plugin (WordPress Job Manager). The plugins are storing data differently in certain parts of the data.

The old plugin stores education and experience in the standard database format. So it stores the dates, title, description, company or school all in their own separate columns with each row being a separate type of experience.

With the new plugin we are moving to all of this data (dates, title description and company/school) is stored in one single column in a serilised format, example below:

a:2:{i:0;a:4:{s:8:"location";s:17:"barry school name";s:13:"qualification";s:10:"barry qual";s:4:"date";s:10:"23131/3231";s:5:"notes";s:0:"";}i:1;a:4:    {s:8:"location";s:9:"schol no2";s:13:"qualification";s:13:"school 2 qual";s:4:"date";s:10:"23213/1313";s:5:"notes";s:0:"";}}

Even multiple types of experiences are stored in the single column.

I'm slightly confused how one would go about transferring it in to this serialized manner when each of the data I'm attempting to transfer is stored in a regular column. Any advice is appreciated!

  • 3
    Your going to run into major issues the moment you need to search for anything inside that data structure. Also keep in mind that there are security risks involved with deserialising, e.g. if you serialise an object then deserialise it, all the code in its constructor will run, which can be a security risk. If you must serialise, do it with json_encode. I would recommend using post meta for each field instead of bundling it all together like this – Tom J Nowell Jul 24 '16 at 22:54
  • Also using serialized instead of single data will actively kill any chance to search that data. – kaiser Jul 25 '16 at 0:28
  • The problem is that the new plugin I'm using (WP Job Manager), the data within certain custom fields are stored like this. – Nicholas Rowe Jul 25 '16 at 9:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.