# Download and restore of site settings

**URL:** https://meta.discourse.org/t/download-and-restore-of-site-settings/65230
**Category:** Development
**Created:** [27 juni 2017 om 20:43 UTC](https://meta.discourse.org/t/download-and-restore-of-site-settings/65230 "2017-06-27T20:43:26Z")
**Posts on this page:** 1
**Showing post:** 7

<div class="post-metadata">

### Author: ![blake](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blake/32/157322_2.png) [@blake](https://meta.discourse.org/u/blake)
#### Post date: [15 februari 2018 om 23:50 UTC](https://meta.discourse.org/t/download-and-restore-of-site-settings/65230/7 "2018-02-15T23:50:15Z")

</div>

A rake task for this now exists!

[https://github.com/discourse/discourse/commit/925d1a78697dfb8e9549e0b9ba4f7e7f18235cfe](https://github.com/discourse/discourse/commit/925d1a78697dfb8e9549e0b9ba4f7e7f18235cfe)

Here is an example of an import. It checks for bad settings (NOT FOUND), should show any errors (setting a username that doesn’t exist), and show you which settings changed, and will only update a value if the new setting is different from the current value.

```plaintext
$ rake site_settings:import < ~/tmp/settings.yml

starting import...

NOT FOUND: existing site setting not found for blake_key
Changed title FROM: Discourse TO: Blake's Site
Changed site_description FROM: TO: Blake's test site
ERROR: site_contact_username: There's no user with that username.
Changed invite_only FROM: f TO: true
Changed login_required FROM: f TO: true

Results:
 Updated: 4
 Not Found: 1
 Errors: 1

```

Afterwards you can also check the Staff Action logs to verify the changes.

@pfaffman I do still really like your api version, and I would be the perfect tool to add to the [discourse CLI app](https://github.com/oblakeerickson/discourse_cli) that I started working on a couple of years go that I haven’t had time for but would still like to exist.

---

_[View the full topic](https://meta.discourse.org/t/download-and-restore-of-site-settings/65230)._
