7

Using Assets 2.x in a recent site build. When we initially built the site, we didn't opt for S3 as it wasn't approved by the client. Since then, the site has yet to launch and thinking has changed - S3 is now the preferred option.

Question: Is there any relatively painless way to migrate existing Assets to S3 - mind you we're using WYGWAM, Matrix, Playa on the site. Essentially, looking to know whether or not we can avoid manually accessing each entry and migrating those Assets.

Thanks in advance for your advice!

Cheers, Michael

5

Backup your database first, of course, but theoretically this should be easy-peasy: Just add your S3 sources in the settings and then, in the Assets File Manager just drag all your files and folders from your EE sources to S3 sources and that's that - no changes in entries should be required at all.

| improve this answer | |
  • This doesn't really seem to work. Setup S3 source and manually dragged assets from the local source to the S3 source. Just curious, how would this update asset paths in Wygwam fields? All paths are still pointing to the local source. Updated indexes and cleared all caches, but still all assets are pointing to the local source. At ideas or direction? – Synergema Mar 20 '13 at 22:32
  • Learning more about this - it appears that Assets fields in a Matrix for example will reindex when moving a local assets to an S3 source. However, images in a Wygwam field don't update, and it looks like those assets aren't associated in the database. So, wondering if it's even possible to do this without manually going into each Wygwam field individually? And, I may be answering my own question with this thread: expressionengine.stackexchange.com/questions/5779/… Can anyone @ Pixel and Tonic just confirm this behavior? Thanks for your help! – Synergema Mar 21 '13 at 1:06
  • 1
    Synergema, when you are using an Assets field, we're able to store a reference, because we're not storing just a block of HTML. In the case of Wygwam, however, we have to render HTML and store the said HTML, hence we can only store a link and not the reference. I'm not sure if that would be possible to store a {asset_XXX} tag and then parse it with Javascript and then, before saving, parse it back to {asset_XXX} and if that is possible at all, but we'll look into it to see if we can come up with a neat solution for this in future Wygwam versions. Long story short - have to manually re-save. – Andris Sevcenko Mar 21 '13 at 8:22
  • Thanks Andris for your response. Just to confirm, the {asset_XXX} tag was new to Wygwam 2.7, right? I did go through and re-connect Assets in Wygwam fields, re-saved the entry. Once I did that, if I moved an asset from a local source to an S3 source, the URL did update. All the content was created before Wygwam 2.7. As you mentioned, it would be handy to have a script to do that. Thanks for your help! – Synergema Mar 21 '13 at 12:01
  • Synergema - Just to confirm, yes, the {asset_XXX} tag was introduced in Wygwam 2.7. I also just fixed a bug locally that had to do with selecting Assets images stored in S3 from Wygwam, so let us know if you run into any other issues. – Brad Bell Mar 23 '13 at 0:17

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.