A user, plague69, is seeking help with changing the S3 endpoint in a Discourse self-hosted setup from http://discourse.domain.tld:9000 to http://discourse.domain.tld:9001. Despite multiple steps—including updating settings, rebaking posts, clearing caches, using rake posts:remap, and directly editing the database—the old endpoint persists in both new and old posts, including short URLs. Falco suggests setting the endpoint via an environment variable in app.yml, but this fails. plague69 also asks if posts can be migrated from S3 to local storage, noting the absence of a rake uploads:migrate_from_s3 task. pfaffman suggests searching for a relevant rake task to accomplish this.
Just can’t seem to get this to work. Old endpoint still in all the posts.
Steps:
Change “s3 Endpoint” in admin settings
Rebaked all posts “rake posts:rebake”
Cleared redis cache
After confirming the above didn’t work:
rake posts:remap[‘old endpoint without http’, ‘new endpoint without http’]
rebake all posts
restarted container
restarted whole server
after this didn’t work:
edit sql replace all old endpoint with new endpoint in “posts” table in “raw” and “image_url” columns
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.
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.
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)