7913 Posts in 1355 Topics by 930 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, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 1197 Views |
-
Uploadify: Moving existing files to Amazon S3 storage

11 September 2010 at 2:58am
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?
-
Re: Uploadify: Moving existing files to Amazon S3 storage

11 September 2010 at 3:22pm
FYI-if your uploadify is attached to the DataObjectManager, its not ready for the S3. Cheese said it will be updated soon though.
-
Re: Uploadify: Moving existing files to Amazon S3 storage

14 September 2010 at 1:35am
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.BucketOnce 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.
| 1197 Views | ||
|
Page:
1
|
Go to Top |


