Migrating uploads to S3 for 'default'...
Uploading files to S3...
- Listing local files
=> 23 files
- Listing S3 files
. => 94 files
- Syncing files to S3
.......................
Updating the URLs in the database...
Removing old optimized images...
Flagging all posts containing lightboxes for rebake...
4 posts were flagged for a rebake
4 posts still require rebaking and will be rebaked during regular job
Done!
Migrating uploads to S3 for 'default'...
Uploading files to S3...
- Listing local files
=> 23 files
- Listing S3 files
. => 94 files
- Syncing files to S3
.......................
Updating the URLs in the database...
Removing old optimized images...
Flagging all posts containing lightboxes for rebake...
4 posts were flagged for a rebake
4 posts still require rebaking and will be rebaked during regular job
Done!
Migrating uploads to S3 for 'default'...
Uploading files to S3...
- Listing local files
=> 23 files
- Listing S3 files
. => 94 files
- Syncing files to S3
.......................
Updating the URLs in the database...
Removing old optimized images...
Flagging all posts containing lightboxes for rebake...
4 posts were flagged for a rebake
4 posts still require rebaking and will be rebaked during regular job
Done!
Migrating uploads to S3 for 'default'...
Uploading files to S3...
- Listing local files
=> 23 files
- Listing S3 files
. => 94 files
- Syncing files to S3
.......................
and it just keeps going.
Ultimately I hit ctrl-C and did rake posts:rebake which worked fine.
Then for kicks I tried the rake uploads:migrate_to_s3 command again, which did exactly the same thing again as above (same output, same endless loop).
Not sure what’s going on, or if this is a problem or not, but wanted to report. Any thoughts?
I built a new image with DISCOURSE_S3_XXX variables set to enable S3 uploads when the original database was migrated. I would think that this would put all images on S3 from the get-go, but, alas, restoring that backup fails when it tries to migrate to S3.
I then tried to rake uploads:migrate_to_s3 (with all ENV set in the command line before it) and get the infinite loop described in the OP.
I then tried doing a command line restore with all of the DISCOURSE_S3 settings in the command line.
I thought that maybe then I could do a backup and restore, but no. Restore from the web interface fails. Restore from the command line, without passing all of the S3 parameters also fails.
So, it appears that if you want to restore a backup that has uploads in S3, you need to do it from the command line and pass the S3 settings on the command line with the restore.
Not being able to restore a backup that has S3 uploads from the UX seems like a bug.
For the next person trying to do a restore here’s the exact syntax to put the command line options all on the same line with the restore command as @pfaffman recommends)… it’s just all four variables being defined and then the restore command at the very end.