Skip to content

How to migrate files from local persistent storage with CarrierWave correctly? #62

Description

@afuno

Initially, the application used local persistent storage. I tried moving the entire uploads directory into ImageKit. I kept the previous configuration and added a new one from ImageKit:

classBaseUploader < CarrierWave::Uploader::BaseincludeImageKitIo::CarrierWavedefstore_dirfull_file_pathend# ...defoptions{response_fields: "isPrivateFile, tags",tags: %w[images],use_unique_file_name: false,folder: full_file_path}endprivate# ...deffull_file_path"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{dirs}"end# ...end

As a result I get this error:

unexpected token at 'f1843b5f9.jpg'

From this line:

=image_tagband.card_image.url

In this case, the full name of the file in the database is: 9757131f1843b5f9.jpg.

Please tell me what else needs to be done to migrate files?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions