Take the 2-minute tour ×
Craft CMS Stack Exchange is a question and answer site for administrators, end users, developers and designers for Craft CMS. It's 100% free, no registration required.

S3 is seemingly costing us a lot. While it has its benefits, I think we could do with moving images from s3 to the server we are running the site from. How difficult/impossible of a task would that be?

share|improve this question
    
When I say a lot, $25 after 2 days in production –  Sean O'Grady Jul 17 at 13:23

2 Answers 2

up vote 8 down vote accepted

The easiest way I imagine would be to

  1. Create a local folder
  2. Download all the files into the folder (outside of Assets - via Transmit or similar)
  3. Change your source settings from S3 to Local with correct paths

And you're done. Whoa, that was easy :)

share|improve this answer
1  
Wouldn't step 4 be to update indexes? –  Matt Stein Jul 17 at 14:02
2  
Assets stores the whole structure relative to the Source. The thumbnails are stored based on the Assets ID. None of those parameters change so, from Assets Index point of view nothing has changed at all. –  Andris Sevcenko Jul 17 at 14:13
    
Smart! Thanks for clarifying, Andris. –  Matt Stein Jul 17 at 14:16

Ignore my answer. Andris' is better.

There is no functionality in Craft that I'm aware of, but you should be able to handle it similar to moving a website. The hardest part I think would be updating fields and references within entries.

  1. Set up your new asset source (whether local or another object store).
  2. Move all of your files to the new source.
  3. Go to the settings page in the control panel. First icon under Tools is Update Asset Indexes.
  4. Add your new source to Asset fields, and go update all of the entries.
  5. After the entries are updated, you can just delete the old asset source.

There's really no automated way to update fields and entries, but it might be possible with a really clever plugin.

share|improve this answer
1  
Wouldn't changing the asset-source type to local, keep all relations? And just moving the files + updating the asset indexes be enough? –  Victor In Jul 17 at 13:35
1  
Simply changing the source type would be sufficient in this case, provided that the files are copied to the local server. –  Andris Sevcenko Jul 17 at 13:41
    
I'm not sure. It depends on how they're stored in the database. I'll go check and update my answer if I find anything that suggests what you say will work. –  Bryan Redeagle Jul 17 at 13:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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