# Moving /var/discourse and /var/lib/docker

**URL:** https://meta.discourse.org/t/moving-var-discourse-and-var-lib-docker/198105
**Category:** Support
**Created:** [July 25, 2021, 2:40am UTC](https://meta.discourse.org/t/moving-var-discourse-and-var-lib-docker/198105 "2021-07-25T02:40:58Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Jasmine\_S-M](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jasmine_s-m/32/228775_2.png) [@Jasmine\_S-M](https://meta.discourse.org/u/Jasmine_S-M)
#### Post date: [July 25, 2021, 2:40am UTC](https://meta.discourse.org/t/moving-var-discourse-and-var-lib-docker/198105/1 "2021-07-25T02:40:58Z")

</div>

I need to free up disk space as our main volume is almost full.

I tried:

```plaintext
cd /var/discourse
./launcher stop app

cd /var/
cp -R discourse /mnt/forums/discourse
mv discourse/ discourse-backup/
ln -s /mnt/forums/discourse discourse

cd /var/lib/
cp -R docker /mnt/forums/docker
mv/docker/ docker-backup
ln -s /mnt/forums/docker docker
 
cd /var/discourse
./launcher start app

```

Everything seems to start but nothing works, just a 502 gateway error.

What mistake could I have possibly made and what is the best way to troubleshoot?

This move would free up 225+gb for us.

---

<div class="post-metadata">

### Author: ![Jasmine\_S-M](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jasmine_s-m/32/228775_2.png) [@Jasmine\_S-M](https://meta.discourse.org/u/Jasmine_S-M)
#### Post date: [July 26, 2021, 4:42pm UTC](https://meta.discourse.org/t/moving-var-discourse-and-var-lib-docker/198105/2 "2021-07-26T16:42:17Z")

</div>

Bumping for some thoughts from other community members.

---

<div class="post-metadata">

### Author: ![Ed\_S](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ed_s/32/134015_2.png) [@Ed\_S](https://meta.discourse.org/u/Ed_S)
#### Post date: [July 27, 2021, 9:53am UTC](https://meta.discourse.org/t/moving-var-discourse-and-var-lib-docker/198105/4 "2021-07-27T09:53:50Z")

</div>

Possibly an ownership or permissions error? I prefer to use `cp -a` (as root) although even that’s not necessarily a perfect copy - use `tar` or `cpio` for that.

Possibly something doesn’t like links, in which case a mount or loopback mount might be better.

Ideally, though, there’s a log somewhere which tells us what it was which didn’t start or didn’t like what it found.

---

<div class="post-metadata">

### Author: ![Jasmine\_S-M](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jasmine_s-m/32/228775_2.png) [@Jasmine\_S-M](https://meta.discourse.org/u/Jasmine_S-M)
#### Post date: [July 27, 2021, 6:54pm UTC](https://meta.discourse.org/t/moving-var-discourse-and-var-lib-docker/198105/5 "2021-07-27T18:54:59Z")

</div>

Thanks. I ended up moving `shared/` and trimming the `overlay2` directory. This helped quite a bit.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [August 26, 2021, 6:55pm UTC](https://meta.discourse.org/t/moving-var-discourse-and-var-lib-docker/198105/6 "2021-08-26T18:55:25Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
