# 还有其他方法进行备份和恢复吗？

**URL:** <https://meta.discourse.org/t/any-other-way-to-take-backup-and-restore/47033>\
**Category:** Support\
**Created:** [2016年七月9日 12:57 UTC](https://meta.discourse.org/t/any-other-way-to-take-backup-and-restore/47033 "2016-07-09T12:57:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![srikanth413](https://avatars.discourse-cdn.com/v4/letter/s/76d3ee/32.png) [@srikanth413](https://meta.discourse.org/u/srikanth413)\
**Post date:** [2016年七月9日 12:57 UTC](https://meta.discourse.org/t/any-other-way-to-take-backup-and-restore/47033/1 "2016-07-09T12:57:46Z")

</div>

hi,

is there any other way (except this admin → settings → backup or Restore) to take backup and restore in our discourse forum. like from coding part and any other best way.

---

<div class="post-metadata">

**Author:** ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)\
**Post date:** [2016年七月9日 22:53 UTC](https://meta.discourse.org/t/any-other-way-to-take-backup-and-restore/47033/2 "2016-07-09T22:53:54Z")

</div>

You can backup and restore with a script:

```bash
# enter the Docker container
/var/discourse/launcher enter app

discourse backup <optional filename>
discourse restore filename

```

You can do even more with that script:

```plaintext
Commands:
  discourse backup # Backup a discourse forum
  discourse disable_readonly # Disable the readonly mode
  discourse disable_restore # Forbid restore operations
  discourse enable_readonly # Enable the readonly mode
  discourse enable_restore # Allow restore operations
  discourse export # Backup a Discourse forum
  discourse export_category # Export a category, all its topics, and all users who posted in those topics
  discourse export_topics # Export topics and all users who posted in that topic. Accepts multiple topic id's
  discourse help [COMMAND] # Describe available commands or one specific command
  discourse import # Restore a Discourse backup
  discourse import_category # Import a category, its topics and the users from the output of the export_category co...
  discourse import_topics # Import topics and their users from the output of the export_topic command
  discourse remap # Remap a string sequence accross all tables
  discourse request_refresh # Ask all clients to refresh the browser
  discourse restore # Restore a Discourse backup
  discourse rollback # Rollback to the previous working state

Options:
  v, [--verbose=VERBOSE]

```

---

<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:** [2019年六月22日 05:07 UTC](https://meta.discourse.org/t/any-other-way-to-take-backup-and-restore/47033/6 "2019-06-22T05:07:21Z")

</div>



---

<div class="post-metadata">

**Author:** ![justin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/justin/32/157614_2.png) [@justin](https://meta.discourse.org/u/justin)\
**Post date:** [2019年六月23日 01:56 UTC](https://meta.discourse.org/t/any-other-way-to-take-backup-and-restore/47033/7 "2019-06-23T01:56:20Z")

</div>

We have a nice howto on restoring a backup from the CLI.

> [@Restore a backup from the command line](https://meta.discourse.org/t/restore-a-backup-from-command-line/108034):
>
> bookmark This guide explains how to restore a Discourse backup from the command line without using the Discourse web UI. person_raising_hand Required user level: Administrator wrench Console access required Here’s how to restore a Discourse backup from the command line, without ever booting the Discourse web UI. This is handy when you’re moving servers. Prerequisites Before you start, make sure you complete the following steps: Download the latest backup file from the source Disco…

---

<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:** [2022年十二月6日 08:07 UTC](https://meta.discourse.org/t/any-other-way-to-take-backup-and-restore/47033/8 "2022-12-06T08:07:43Z")

</div>



---

<div class="post-metadata">

**Author:** ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)\
**Post date:** [2022年十二月6日 10:31 UTC](https://meta.discourse.org/t/any-other-way-to-take-backup-and-restore/47033/9 "2022-12-06T10:31:04Z")

</div>


