# Migration zu S3 schlägt bei Rebake fehl

**URL:** https://meta.discourse.org/t/migrate-to-s3-fails-on-rebake/151486
**Category:** Self-hosting
**Created:** [14. Mai 2020 um 13:08 UTC](https://meta.discourse.org/t/migrate-to-s3-fails-on-rebake/151486 "2020-05-14T13:08:45Z")
**Posts on this page:** 1
**Showing post:** 15

<div class="post-metadata">

### Author: ![ipoopfool](https://avatars.discourse-cdn.com/v4/letter/i/d78d45/32.png) [@ipoopfool](https://meta.discourse.org/u/ipoopfool)
#### Post date: [13. Juli 2021 um 00:18 UTC](https://meta.discourse.org/t/migrate-to-s3-fails-on-rebake/151486/15 "2021-07-13T00:18:24Z")

</div>

Ich bin auf ein ähnliches Problem gestoßen, möglicherweise verursacht durch die Migration von AWS S3 → lokal → DO Spaces. Am Ende habe ich etwas Ruby-Code geschrieben, um alte defekte Upload-URLs manuell durch das aktualisierte, funktionierende URL-Format zu ersetzen, und das scheint mein Problem behoben zu haben.

In meinem Fall wurden alle Dateien bei der ersten Migration erfolgreich zu DO Spaces verschoben, aber `migrate_to_s3` hat sie als Fehler protokolliert. Dies hat die Anhänge zunächst nicht beeinträchtigt, aber das Ausführen eines Rebuilds hat sie beschädigt. Weitere Details finden Sie im verlinkten Thema.

> [@ToS3MigrationError: uploads not migrated to S3, leading to broken attachments. How to fix this error?](https://meta.discourse.org/t/tos3migrationerror-uploads-not-migrated-to-s3-leading-to-broken-attachments-how-to-fix-this-error/196115):
>
> FileStore::ToS3MigrationError: 182 of 21512 uploads are not migrated to S3. S3 migration failed for db ‘default’. then some stack trace from ‘raise\_or\_log’, ‘migration\_successful?’, ‘migrate\_to\_s3’, ‘migrate’, ‘block in migrate\_to\_s3\_all\_sites’ I ran into these errors twice when running the task uploads:migrate\_to\_s3 . About 1% of the files were not successfully migrated, leading to broken attachments on the site after a rebake. These all seem to be older files around the initial few month…

---

_[View the full topic](https://meta.discourse.org/t/migrate-to-s3-fails-on-rebake/151486)._
