# Restoring forum to a new server

**URL:** https://meta.discourse.org/t/restoring-forum-to-a-new-server/127357
**Category:** Support
**Created:** [September 1, 2019, 11:06pm UTC](https://meta.discourse.org/t/restoring-forum-to-a-new-server/127357 "2019-09-01T23:06:57Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![markwill](https://avatars.discourse-cdn.com/v4/letter/m/90db22/32.png) [@markwill](https://meta.discourse.org/u/markwill)
#### Post date: [September 1, 2019, 11:06pm UTC](https://meta.discourse.org/t/restoring-forum-to-a-new-server/127357/1 "2019-09-01T23:06:58Z")

</div>

For the various production services I run (WordPress sites, etc) I like to run a second, “mirror” site, as well as the production site. For example, I might have `www.mydomain.com` and also `mirror.mydomain.com`. The latter is created by cloning from the production site and then disabling a couple of processes that don’t need to run.

I’d like to do the same with my forum. As I understand, the restore function is “all in”, it restores not just the data (topics, etc) but also the entire configuration. That leaves me with two issues I’d like to understand better.

1. I use WordPress SSO. After the restore is complete I want the `mirror-forum.mydomain.com` Discourse site to point to `mirror.mydomain.com`, as the logon source. How would I modify the mirrored forum site (catch 22 of course - after restore and logging on, the mirrored site would presumably point to the production site)?

2. I want to be 100% sure that no eMails are sent from the mirrored forum site. Again, if I restore to the mirrored forum site then I assume all the scheduled tasks from the production site (sending digest emails to users, etc) will be scheduled, right? How can I avoid that? Is there a central location to turn off ALL eMails from that server?

How can I approach this?

Thank you.

---

<div class="post-metadata">

### Author: ![csmu](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/csmu/32/124581_2.png) [@csmu](https://meta.discourse.org/u/csmu)
#### Post date: [September 2, 2019, 2:18am UTC](https://meta.discourse.org/t/restoring-forum-to-a-new-server/127357/2 "2019-09-02T02:18:28Z")

</div>

Have a look through [Syncing Production to Staging](https://meta.discourse.org/t/syncing-production-to-staging/109801)

especially [That sounds like a good approach](https://meta.discourse.org/t/syncing-production-to-staging/109801/2)

Here is a script we use to keep a staging site mirrored to production site.

```plaintext
#!/bin/bash
echo "cd /var/www/discourse"
cd /var/www/discourse

echo "/usr/local/bin/rake site_settings:export > /var/www/discourse/settings.yml"
/usr/local/bin/rake site_settings:export > /var/www/discourse/settings.yml

echo "cd /var/www/discourse/public/backups/default"
cd /var/www/discourse/public/backups/default

echo "/usr/local/bin/discourse restore " $(ls -r | head -1)
/usr/local/bin/discourse restore $(ls -r | head -1)

echo "cd /var/www/discourse"
cd /var/www/discourse

echo "/usr/local/bin/rake site_settings:import < /var/www/discourse/settings.yml"
/usr/local/bin/rake site_settings:import < /var/www/discourse/settings.yml

```

It’s called from docker.

Example of calling a script from outside the discourse instance:

```plaintext
echo 'cd /var/www/discourse; RUBY_ENV=production rails r /var/www/discourse/script/import_scripts/wordpress-with-sabai-export.rb /var/www/discourse/script/import_scripts/wordpress-discourse-id-map.json' | docker exec -i $(docker ps | grep app | awk '{print $1}') /bin/bash

```

---

<div class="post-metadata">

### Author: ![csmu](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/csmu/32/124581_2.png) [@csmu](https://meta.discourse.org/u/csmu)
#### Post date: [September 2, 2019, 5:50am UTC](https://meta.discourse.org/t/restoring-forum-to-a-new-server/127357/3 "2019-09-02T05:50:00Z")

</div>

> [@markwill](#):
>
> I want to be 100$ sure that no eMails are sent from the mirrored forum site.

Set the mirrored site disable email setting to ‘yes’

https://{fully-qualiified-domain-name}/admin/site\_settings/category/email?filter=disable%20email

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [September 2, 2019, 7:25am UTC](https://meta.discourse.org/t/restoring-forum-to-a-new-server/127357/4 "2019-09-02T07:25:07Z")

</div>

> [@markwill](#):
>
> s there a central location to turn off ALL eMails from that server?

Yes, disable email from your site settings. Or you can set email to staff-only which is helpful sometimes.

---

<div class="post-metadata">

### Author: ![markwill](https://avatars.discourse-cdn.com/v4/letter/m/90db22/32.png) [@markwill](https://meta.discourse.org/u/markwill)
#### Post date: [September 2, 2019, 2:46pm UTC](https://meta.discourse.org/t/restoring-forum-to-a-new-server/127357/5 "2019-09-02T14:46:00Z")

</div>

Great stuff everyone. This looks like it gives me all I need. Thank you.

---

<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: [October 2, 2019, 2:46pm UTC](https://meta.discourse.org/t/restoring-forum-to-a-new-server/127357/6 "2019-10-02T14:46:06Z")

</div>

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