Any other way to take backup and restore?


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.

1 Like

You can backup and restore with a script:

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

discourse backup <optional filename>
discourse restore filename

You can do even more with that script:

  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

  v, [--verbose=VERBOSE]

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