Jump to:

7939 Posts in 1472 Topics by 944 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » Uploadify: Moving existing files to Amazon S3 storage

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1381 Views
  • Ryan M.
    Avatar
    Community Member
    309 Posts

    Uploadify: Moving existing files to Amazon S3 storage Link to this post

    About to install the Uploadify module and use it to upload files to Amazon S3. However I already have a ton of existing files, and I'd like to move these to S3 as well. Has anyone done this before? If so, what's the procedure for updating the existing files with their new URLs?

  • otherjohn
    Avatar
    Community Member
    125 Posts

    Re: Uploadify: Moving existing files to Amazon S3 storage Link to this post

    FYI-if your uploadify is attached to the DataObjectManager, its not ready for the S3. Cheese said it will be updated soon though.

  • UncleCheese
    Avatar
    4085 Posts

    Re: Uploadify: Moving existing files to Amazon S3 storage Link to this post

    Hi, Ryan,

    S3File is a different model from the standard SilverStripe File class, as you've probably noticed. The three key fields are:

    - Name (the base filename, e.g. "some-image.jpg"
    - Bucket (the S3 bucket, e.g. "my-uploaded-files")
    - The URL (http://my-uploaded-files.amazonaws.com/some-image.jpg)

    So a migration process might look like this:

    Map File.ID to S3File.ID (assuming S3File table is empty)
    Map File.Name to S3File.Name
    Map File.Parent.Name to S3File.Bucket

    Once that's all in place, run an update to the S3 table to create URL fields that represent a concatenation of [url=http://[Bucket].amazonaws.com/]http://[Bucket].amazonaws.com/[Name]

    Then, update all your models to point to S3File instead of "File"..

    You'll probably have to massage the data a bit, but you get the idea.

    1381 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.