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.
Backup and Restore in Discourse Forum
There are alternative methods to backup and restore a Discourse forum besides using the admin panel. gerhard suggests using a script to backup and restore:
discourse backup <optional filename>
discourse restore filename
This script offers additional commands for managing backups and restores:
discourse help [COMMAND]
discourse export
discourse export_category
discourse export_topics
discourse import
discourse import_category
discourse import_topics
For a step-by-step guide, justin recommends checking out the How-to on restoring a backup from the CLI.
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.
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]
We have a nice howto on restoring a backup from the CLI.