0.0
No commit activity in last 3 years
No release in over 3 years
This gem can move your content from one server to another
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme

party_mover

Move your content uploaded by CarrierWave from one server to another

Usage

Imagine you have User class with avatar:

class User < ActiveRecord::Base
  # ...
  mount_uploader :avatar, AvatarUploader 
end

And the next AvatarUploader configured for Amazon S3:

class AvatarUploader < CarrierWave::Uploader::Base
  storage :aws
  # ...
end

Create another AnotherAvatarUploader configured for another server:

class AnotherAvatarUploader < CarrierWave::Uploader::Base
  storage :fog

  def initialize(*)
    super
    self.fog_credentials = {
      :provider               => "YOUR_PROVIDER",
      :openstack_auth_url     => "YOUR_AUTH_URL",
      :openstack_username      => "YOUR_USERNAME",
      :openstack_api_key  => "YOUR_API_KEY",
    }
    self.fog_directory = "YOUR_DIRECTORY"
  end
end

And move your avatars with PartyMover:

PartyMover.move!(AnotherAvatarUploader, :avatar, User.all)

After that just reconfigure your AvatarUploader for new server or change your User model in this way:

class User < ActiveRecord::Base
  # ...
  mount_uploader :avatar, AnotherAvatarUploader 
end