# Move Uploads and Backups to DigitalOcean Block Storage

**URL:** https://meta.discourse.org/t/move-uploads-and-backups-to-digitalocean-block-storage/89274
**Category:** Self-Hosting
**Tags:** how-to
**Created:** [June 6, 2018, 5:35pm UTC](https://meta.discourse.org/t/move-uploads-and-backups-to-digitalocean-block-storage/89274 "2018-06-06T17:35:05Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Discourse](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/discourse/32/148734_2.png) [@Discourse](https://meta.discourse.org/u/Discourse)
#### Post date: [June 6, 2018, 5:35pm UTC](https://meta.discourse.org/t/move-uploads-and-backups-to-digitalocean-block-storage/89274/1 "2018-06-06T17:35:05Z")

</div>

So you want to move all uploads and backups to [DigitalOcean Block Storage](https://www.digitalocean.com/community/tutorials/an-introduction-to-digitalocean-block-storage)?

Before you do this, though, you might instead consider [Configure an S3 compatible object storage provider for uploads](https://meta.discourse.org/t/using-object-storage-for-uploads-s3-clones/148916). It is no more complicated to set up and provides some other advantages.

### Setup a Discourse instance on DigitalOcean

Setup a Discourse instance on DigitalOcean using our [official guide](https://github.com/discourse/discourse/blob/main/docs/INSTALL-cloud.md).

### Add a Volume to your droplet

[Add](https://www.digitalocean.com/community/tutorials/an-introduction-to-digitalocean-block-storage) a block storage volume to your droplet. Note down the name of the volume. In my case the name of the volume was `volume-nyc1-05`.

Make sure the volume is formatted and mounted at `/mnt/volume_nyc1_05`.

### Move `/var/discourse/shared` to the volume

For best performance we will keep `postgres_data` on our main drive and will move rest of the data to the newly attached volume.

Logged in as root, run these commands from your server:

```plaintext
mv /var/discourse/shared/standalone/postgres_data /var/postgres_data_discourse
mv /var/discourse/shared /mnt/volume_nyc1_05

```

Make sure to replace `volume_nyc1_05` with the name of your volume.

### Edit `app.yml` to reflect the changes

Open the `/var/discourse/containers/app.yml` file in your preferred editor and look for this block:

```plaintext
## The Docker container is stateless; all data is stored in /shared
volumes:
  - volume:
      host: /var/discourse/shared/standalone
      guest: /shared
  - volume:
      host: /var/discourse/shared/standalone/log/var-log
      guest: /var/log

```

Replace the above block with:

```plaintext
## The Docker container is stateless; all data is stored in /shared
volumes:
  - volume:
      host: /mnt/volume_nyc1_05/shared/standalone
      guest: /shared
  - volume:
      host: /mnt/volume_nyc1_05/shared/standalone/log/var-log
      guest: /var/log
  - volume:
      host: /var/postgres_data_discourse
      guest: /shared/postgres_data

```

Make sure to replace `volume_nyc1_05` with the name of your volume.

Save the `app.yml` file and rebuild the container.

```plaintext
/var/discourse/launcher rebuild app

```

### 🎉 Voila!

That’s it all your uploads and backups are now moved to DigitalOcean Block Storage.

* * *

### Credits

This guide is inspired from @sam’s suggestion [here](https://meta.discourse.org/t/docker-uses-root-partition-might-need-more-storage-space/69298/8).

> Last edited by @JammyDodger 2024-05-25T11:04:25Z
> 
> > **Check document**
> >
> > Perform check on document:

---

<div class="post-metadata">

### Author: ![satonotdead](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/satonotdead/32/447830_2.png) [@satonotdead](https://meta.discourse.org/u/satonotdead)
#### Post date: [May 17, 2023, 1:26pm UTC](https://meta.discourse.org/t/move-uploads-and-backups-to-digitalocean-block-storage/89274/30 "2023-05-17T13:26:17Z")

</div>

I’m trying to follow this approach in Hetzner that have a similar storage but I wonder if that could hurt our general performance.

I read that will offer 1/3 of the SSD speed but I’m talking about notable difference in daily use for uploads and showing files in our Discourse instance because I’m not sure if that 1/3 really impacts or is OK for uploading files.

_Of course, the final result depends of our CPU, RAM and what filesystem and block size are using._

Someone wants to share their experience? 🙂

> Thanks for the guide!

---

<div class="post-metadata">

### Author: ![Kartoon](https://avatars.discourse-cdn.com/v4/letter/k/e36b37/32.png) [@Kartoon](https://meta.discourse.org/u/Kartoon)
#### Post date: [September 14, 2023, 1:49am UTC](https://meta.discourse.org/t/move-uploads-and-backups-to-digitalocean-block-storage/89274/31 "2023-09-14T01:49:42Z")

</div>

Should you turn off the droplet before doing this? I would normally assume yes but since it’s just shuffling uploads?

---

<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: [September 15, 2023, 12:53am UTC](https://meta.discourse.org/t/move-uploads-and-backups-to-digitalocean-block-storage/89274/32 "2023-09-15T00:53:35Z")

</div>

> [@Kartoon](#):
>
> Should you turn off the droplet before doing this

No. Just create the space and follow the instructions to get it mounted.

---

<div class="post-metadata">

### Author: ![kOS](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kos/32/441826_2.png) [@kOS](https://meta.discourse.org/u/kOS)
#### Post date: [November 5, 2024, 6:53pm UTC](https://meta.discourse.org/t/move-uploads-and-backups-to-digitalocean-block-storage/89274/34 "2024-11-05T18:53:31Z")

</div>

Thank you for the guidance. After Ive finished all steps and having the forum up again, we constantly witness images that were failed to get loaded. As it has a incorrect path.

Is there any way how I could run a diagnose on that and do some auto fixing?

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [January 3, 2025, 2:19pm UTC](https://meta.discourse.org/t/move-uploads-and-backups-to-digitalocean-block-storage/89274/35 "2025-01-03T14:19:57Z")

</div>

Did you fix the issue in the end?

---

<div class="post-metadata">

### Author: ![kOS](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kos/32/441826_2.png) [@kOS](https://meta.discourse.org/u/kOS)
#### Post date: [January 3, 2025, 5:04pm UTC](https://meta.discourse.org/t/move-uploads-and-backups-to-digitalocean-block-storage/89274/36 "2025-01-03T17:04:50Z")

</div>

nope ☹ havent been able to fix it.
