2

I have a channel with a File field that I'd like to replace with a Matrix field in order to create an image gallery for each channel entry, however there are thousands of entries in the system already that I am worried will be wiped if I modify the field type. Is there a way to incorporate the existing image files into a Matrix entry, or is my best option to create a Matrix gallery alongside the single File field?

Thanks!

2

Your best bet is probably to create the Matrix as a new field. Then you can non-destructively work on copying the data over from the original file field to the new Matrix field.

If you are familiar with working with SQL and the ExpressionEngine database, it shouldn't be too difficult to pull out the current field values and then create/update the necessary records to copy the values over to the Matrix field.

However, if you aren't that familiar with working with the database, you could use the Datagrab add-on. Simply create a template that outputs XML with the current value of the file field and the entry ID. Save the output as an XML file. Then you can re-import that file with Datagrab and update the entries based on the entry ID, and map the file to the Matrix.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.