S3 Endpoint change procedure?

Hi,

Just can’t seem to get this to work. Old endpoint still in all the posts.

Steps:

  1. Change “s3 Endpoint” in admin settings
  2. Rebaked all posts “rake posts:rebake”
  3. Cleared redis cache
    After confirming the above didn’t work:
  4. rake posts:remap[‘old endpoint without http’, ‘new endpoint without http’]
  5. rebake all posts
  6. restarted container
  7. restarted whole server
    after this didn’t work:
  8. edit sql replace all old endpoint with new endpoint in “posts” table in “raw” and “image_url” columns
  9. Rebake all posts

After all this, not only did the old posts retain the old endpoint, new posts with new attachments also has the old endpoint. “short-url” links also link to old endpoint.

What are the correct steps?

#bringBackMinio

Sorry, anyone knows about how to do this? Should be something simple but I can’t figure it out

Any advice here @falco?

1 Like

@plague69 can you share more details about your setup?

What is the old and new S3 Endpoint values?

Are you using a CDN for S3?

1 Like

I didn’t think it mattered? Since if it changes and it’s wrong, then I can fix it, but I’m having a hard time getting it to change

Old Endpoint:
http://discourse.domain.tld:9000

New Endpoint: (Only port changed, had a conflict and other service can not move)
http://discourse.domain.tld:9001

CDN unchanged:
http://files.domain.tld:80

I can remove the CDN if need be, no need at the moment

Thank you @Falco

I have never tried using an S3 server in a non-standard port, because that is not something we test for.

That said, can you try setting up the S3 Endpoint in an environment variable on the app.yml file?

env:
   # current settings ...
   DISCOURSE_S3_ENDPOINT:  http://discourse.domain.tld:9001
2 Likes

That didn’t work I’m afraid. Still stuck on 9000.

After adding that env var, had to rebuild, not just restart the container to take effect. The option is removed from settings so I know it was working and the var was in the startup parameters of the container after rebuild.

Any way to download everything onto local drive if we stop using S3? Since backups don’t include S3, I can’t even backup and restore.

Will posts:rebake redo the short-url’s?

I believe they’re is a S3 to local rake task. You can search here or look in the source. That’s probably your best bet.

There used to be: rake uploads:migrate_from_s3. The Minio to S3 migration script when they took away S3 url formatting (slash instead of sub-domain style)

Right now I can’t see that even

2 Likes