古いアップロードを S3 に移行する方法は?

I now have all new uploads going straight to S3 but now I’d like to move all previous uploads to S3 as well. Is there a How To for this?

I searched the forums and found bits and pieces but not a step by step guide. I was unable to figure it out so far.

You should be able to use the uploads:migrate_to_s3 rake command. This would migrate your local files to the configured S3 bucket.

「いいね!」 3

Hi guys,

I’m in the same boat. But i already moved the /uploads/ folder to it’s new S3. Is there an alternative to uploads:migrate_to_s3 that only relinks but skips actual uploading?

インスタンスをローカルから S3 アップロードに切り替えたのですが、S3 移行ツールがどのように動作するのか、どうしてもわかりませんでした。このトピックを訪れる他の人のために、必要な手順をここにまとめます。

  1. 管理画面で「S3 アップロード」を有効にし、必要な S3 キーと設定をすべて入力して、新しいアップロードが S3 に送信されるようにします。
  2. app.yml の env セクションに、必要な DISCOURSE_S3_ 環境変数を追加します。
    例:
  DISCOURSE_S3_BUCKET: your-bucket-name
  DISCOURSE_S3_REGION: your-s3-bucket-region
  DISCOURSE_S3_ACCESS_KEY_ID: your-s3-access-key-id
  DISCOURSE_S3_SECRET_ACCESS_KEY: your-s3-secret-access-key
  1. ./launcher rebuild app でアプリを再構築します。
  2. ./launcher enter app でアプリにアクセスします。
  3. Docker コンテナ内から rails uploads:migrate_to_s3 を実行します。

当初は ./launcher run app rails uploads:migrate_to_s3 でコマンドを実行しようとしましたが、タスクが見つかりませんでした。

「いいね!」 4