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
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
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
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
cd /var/discourse/
./launcher stop app
Now when forum is stopped, let’s run sync on new VPS again
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.
./launcher rebuild app
Done!
All settings, posts, threads, backups were copied to new location, no UI interaction was needed.