Any other way to take backup and restore?


(srikanth) #1

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.


(Gerhard Schlager) #2

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:

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]

(Matt Palmer) #3

What is insufficient about the backup/restore process that requires you to use an alternate mechanism?


(Alex Armstrong) #4

How can I access this command on a Vagrant install?


(Gerhard Schlager) #5

I’m not sure since I’ve never used Vagrant, but you can find it in the script folder of Discourse.