Simple summary of how to move Discourse to a larger disk

AI-generated summary

Andro asks for instructions on moving an entire self-hosted Discourse Docker instance to a larger block storage volume on the same server, noting that the launcher currently fails to rebuild due to insufficient disk space. NateDhaliwal initially provides links to guides for moving uploads/backups and migrating to a new server, but Andro clarifies they wish to move all data to block storage on the current hardware. Nate responds with a specific procedure derived from the official documentation, suggesting that for optimal performance, the database (postgres_data) should remain on the main drive while the rest of the shared data is moved to the volume. The steps include using mv commands to relocate /var/discourse/shared (excluding postgres_data), editing /var/discourse/containers/app.yml to update the volume mappings, and running launcher rebuild app NateDhaliwal.

However, Andro notes they haven’t verified if the database is the primary space consumer and states that performance is not a priority. Ethsim2 suggests trying docker system prune for broader cleanup, while Ed_S recommends diagnosing the disk usage first. Ed_S provides several commands to identify space hogs, such as df -h, du -kx, and various docker inspection commands (docker system df, docker volume ls). He explains that while uploads are often the largest component, users should measure to see if logs, old images, or other unnecessary files are consuming the space before proceeding with complex migrations.

Are there instructions for how to move an entire Discourse instance to another disk, e.g. a block storage volume from Digital Ocean? I have a self hosted Docker image. There’s some info here about it but its a bit tangled up with other discussion. I am out of space and launcher wont rebuild for that reason, even after trying to remove images.

See:

and:

Not exactly my case. I want to move the Discourse instance to block storage on the same server. I do not want to move to a new server. And I want to move all, not just uploads and backups. Sorry to need so much handholding! I don’t want to mess this up.

Then I think you’d want to look at the first doc I linked. Essentially you would move the uploads and backups to the mounted disk, but keep the database on the main drive.

So unless I’m misunderstanding, this is what you’re trying to do? (And of course, please take a backup before doing this)

I have not checked but I thought its the database taking up the space, and need ing moving. High performance is not a consideration.

have you tried a broader Docker cleanup using docker system prune, rather than just removing images?

Best to start by measuring and sharing your measurements - you might well be right about the best way to proceed, but let’s see the shape of things.

Although the docker prune is a good idea too.

The size of the disk:

df -h /

And the usage of that disk right now:

And the usage by docker:

docker system df
docker images -a
docker image ls
docker volume ls -qf dangling=true

(I’m not a docker expert - that’s probably a bit redundant, but with all of those outputs we should be able to see the docker use)

Overall, your disk usage will be a combination of

  • the operating system
  • swap files
  • various log files
  • your discourse software
  • your backups
  • your database
  • your forum uploads

For many forums, the uploads are the big chunk. But one must measure!

If you’re not an expert linux sysadmin, there will probably be some extra unneeded older things too.