# Move a Discourse site to another VPS with rsync

**URL:** <https://meta.discourse.org/t/move-a-discourse-site-to-another-vps-with-rsync/43812>\
**Category:** Sysadmins\
**Tags:** migrations, how-to\
**Created:** [May 6, 2016, 8:21pm UTC](https://meta.discourse.org/t/move-a-discourse-site-to-another-vps-with-rsync/43812 "2016-05-06T20:21:38Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![SystemZ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/systemz/32/88354_2.png) [@SystemZ](https://meta.discourse.org/u/SystemZ)\
**Post date:** [May 6, 2016, 8:21pm UTC](https://meta.discourse.org/t/move-a-discourse-site-to-another-vps-with-rsync/43812/1 "2016-05-06T20:21:38Z")

</div>

This method is different than restoring file in UI.  
Maybe there is a more downtime but it’s simpler for linux folks without Discourse knowledge and it’s easy to automate.

### Prepare new VPS

First, prepare our new Current Ubuntu LTS VPS with empty Discourse dir, OS upgrade and Docker install

```bash
sudo mkdir -p /var/discourse
sudo apt-get update
sudo apt-get dist-upgrade
wget -qO- https://get.docker.com/ | sh

```

Then, make sure that we are on latest installed kernel and other libraries by just restarting

```bash
sudo reboot

```

### Copy files to new VPS

Let’s copy all Discourse files, this first sync pass will reduce our downtime later.

On our new VPS let’s run

```bash
rsync -rvz example.com:/var/discourse /var

```

where `example.com` is our old VPS with forum files.  
This may take a while so grab some favourite drink.

### Turn off current forum and sync again

After first sync pass, turn off forum on old VPS via

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

```

Now when forum is stopped, let’s run sync on new VPS again

```bash
rsync -rvz --delete example.com:/var/discourse /var

```

`--delete` makes sure that will be 1:1 copy

### Start forum on new host

After final sync we can finally run Discourse.

Rebuild and start container.  
This may take a few minutes.

```bash
./launcher rebuild app

```

Done!  
All settings, posts, threads, backups were copied to new location, no UI interaction was needed.

---

_[View the full topic](https://meta.discourse.org/t/move-a-discourse-site-to-another-vps-with-rsync/43812)._
