Archived from the Transloadit support forum. Originally posted on April 4, 2014; details may be outdated, see our docs for current behavior. Original thread
Do you guys have a written process or suggestion on how to move your assets from using carrierwave to transloadit?
When I unmount Carrierwave I loose the S3 path.
I’m sorry to say that we don’t. This is a pretty specific domain and I think you may have better luck asking on StackOverflow.
If there is a specific question about our service we’re more than happy to help you out.
One suggestion that comes to mind about this issue is that Transloadit accepts path variables that allow you to contruct S3 paths in a variety of ways. Maybe it’s possible to construct a path mimicking Carrierwave’s? But we’re really don’t know Carrierwave that well. Again, if you have a more detailed question we might be able to be more helpful.
this is Robin, I help to maintain the ruby-sdk and rails-sdk of transloadit and I know carrierwave a bit, so I might be able to help
What exactly do you want to achieve? Do you want to reprocess the existing assets by Transloadit (which would make sense if you have new formats or anything like that)? If not, why not go through each asset and save the S3 path to your database and unmount carrierwave then.
Maybe you could go a bit more into detail, I’m sure we can help
Before I start I would like to mention that: I’ve been able to upload my images onto transloadit with my assembler but exporting that asset to S3 and retrieving the S3 public path been a challenge.
*My Issue in details:*
I currently have my app set up with Carrierwave + Fog + S3.
It is hosted on Heroku, so no centralized tmp directory, This is why I couldn’t use carrierwave_backgrounder and decided to use either cloudinary or your service.
I’ve started implementing transloadit but I ran into the following issue:
- I already have assets on my production server that are using CArrierwave
+ fog + S3.
Switching to transloadit will affect the path of the directory because I can’t use the same bucket I am using with carrierave (When I created my bucket I used uppercaseand transloadit won’t accept bucket with uppercase
letters; so I had to create a new bucket only using lowercase and therefore
following the DNS standard).
I currently have 3 challenges
- *Migrating all my current assets to my new bucket *( that i am using with transloadit.)
- *Reprocessing all the path of my images so that they match the transloadit bucket.*
- When I unmount Carrierwave in the model, the full path of the images is
gone and if I assign that fullpath to a different column on that table; for
instance “model.old_picutre_path” ; that path won’t work because it works
with a signature and expire. So I am trying to figure out how to *download the assets back to directly “Reprocess” it with Transloadit and assign the new path to model.picture or model.picture.url*
sorry that this took so long. I’m working with Transloadit on a better documentation for this, because it’s actually a quite common migration.
If I understand you correctly, I’d introduce a new property on the model and iterate over all existing assets getting their current path and move them to the new path. You don’t need to reprocess them, you simply have to move/copy it to your new bucket (this should be doable with fog alone) and set the new path on your asset. Once you’ve done that, you can drop the old property and rename the new one to match the previous one.
Do you have multiple versions per asset? (like different sizes?) Also can you give an example of how a current asset path looks like and how it should like after that?