Need to move your Discourse install to another (local) directory? Let’s get started!
Configure new directory
Ensure the new directory is properly mounted/connected as needed. Then create the folder where Discourse will live.
cd /new/discourse/location mkdir -p shared/standalone
Copy existing files to new location
From this point forward your site will be down.
Stop the container to ensure no changes to the files are made during the transfer.
cd /var/discourse ./launcher stop app
Copy files to new location
rsync -avzh /var/discourse/shared/standalone/ /new/discourse/location/shared/standalone
app.yml and rebuild
app.yml so Discourse runs from the new location.
## 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
## The Docker container is stateless; all data is stored in /shared volumes: - volume: host: /new/discourse/location/shared/standalone guest: /shared - volume: host: /new/discourse/location/shared/standalone/log/var-log guest: /var/log
cd /var/discourse sudo ./launcher rebuild app
Your site will now be back up.
Open your site and confirm everything still looks OK. Ensure that all content (including uploads) is still displaying properly.
Delete files from old location
Once you’re happy everything is working, delete the old Discourse files to regain space.
cd /var/discourse sudo rm -r shared/standalone