# Migration to a Self-Hosted solution from Kubernetes

**URL:** https://meta.discourse.org/t/migration-to-a-self-hosted-solution-from-kubernetes/377198
**Category:** Self-hosting
**Tags:** install, migrations-tooling
**Created:** [August 4, 2025, 12:40pm UTC](https://meta.discourse.org/t/migration-to-a-self-hosted-solution-from-kubernetes/377198 "2025-08-04T12:40:20Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [August 7, 2025, 6:32pm UTC](https://meta.discourse.org/t/migration-to-a-self-hosted-solution-from-kubernetes/377198/2 "2025-08-07T18:32:12Z")

</div>

> [@stevejr](#):
>
> We use an external Postgres DB already for the installation and so this will stay in place.

If it wasn’t already your plan, I’d move to a new database (on the same server) for the migration so you don’t break your existing site.

> [@stevejr](#):
>
> However, we updated some settings via the UI and also using environment variables that the Bitnami installation scripts maps to the Discourse, for example `DISCOURSE_S3_BACKUP_BUCKET` maps to `S3_BACKUP_BUCKET.`

I can’t tell quite what you think Bitnami is doing, but the thing you want in your ENV is `DISCOURSE_S3_BACKUP_BUCKET`. See [Configure an S3 compatible object storage provider for uploads](https://meta.discourse.org/t/configure-an-s3-compatible-object-storage-provider-for-uploads/148916) for how to properly set those S3 variables in your `app.yml`.

> [@stevejr](#):
>
> Is it better to create a brand new database with a fresh install and then do a backup/restore?

If by “better” you mean “will this mean that I won’t break our existing site and leave it in a state where it will never work again?”, the answer is yes. 😉

> [@stevejr](#):
>
> Is it good enough to set the Discourse settings in the required yaml files or should we still use env vars?

Set them in the YML

> [@stevejr](#):
>
> If we do a backup from the UI what will that actually restore - does it update the database?

Yes it will update the database. I would recommend that you [Restore a backup from the command line](https://meta.discourse.org/t/restore-a-backup-from-the-command-line/108034)

> [@stevejr](#):
>
> If the new install is a later version of Discourse will that cause a problem if a restore is attempted?

That’s what you want. The place you restore from has to be the same or newer than the backup version. It’ll migrate the database after it’s restored.

This might be all you need to know and we’re happy to help here for free. If you’d like hands-on your-setup-specific attention, you can contact me or ask for help in #Marketplace.

Also, another option would be to build images and launch those in k8s. I’ve done that a few times and used github to build the images.

---

_[View the full topic](https://meta.discourse.org/t/migration-to-a-self-hosted-solution-from-kubernetes/377198)._
