2

I have a site that has a lot of legacy images taken from the site they were on previously, these are stored in a field called legacy-images as a text input. This is basically the folder path from the domain root.

The problem is I need to harness the power of the file resizing options EE has built in and to do this I need to have all these images setup as a file field. Manually moving them isn't an option as there is around 1500 entries. Any idea how I can achieve this?

2 Answers 2

0

You could try using the EE search and replace tool (Tools > Data > Search and Replace). Just replace the path with {filedir_X}, where X is the ID of the upload destination that you've setup in the CP.

1
  • Thanks for that, using this and @CreateSean's answer I managed to fairly simply pull together the data and get it in the system. Was a lot less painful then expected when it became clear how. Thanks to both of you!
    – Leonard
    Commented May 3, 2013 at 17:14
0

What I would look into doing is setting the directory where the images currently reside as an upload directory. Synchronize the directory so that EE knows where everything is located. At this point you'll need to take note of the file uploads id number and create a database query that will convert the field you need and set everything correctly. Be sure to back up the database before running the query just in case.

My SQL is very weak so am unable to write this out for you strait off here, but I'm sure that google or some other person in the community will help you write the query you need.

You might also try setting up the file upload location as I mentioned and then converting the field in question to a file field and see what happens. Be sure to backup the database before doing this just in case it doesn't work. - this second option is probably not the best approach.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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