mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
FEATURE: Allow pausing of restore before DB migration and uploads are restored (#30269)
This can be helpful if you need to fix problems in the DB before the DB gets migrated as well as before uploads are restored.
This commit is contained in:
@ -154,7 +154,14 @@ class DiscourseCLI < Thor
|
||||
end
|
||||
|
||||
desc "restore", "Restore a Discourse backup"
|
||||
option :disable_emails, type: :boolean, default: true
|
||||
option :disable_emails,
|
||||
type: :boolean,
|
||||
default: true,
|
||||
desc: "Disable outgoing emails for non-staff users after restore"
|
||||
option :pause,
|
||||
type: :boolean,
|
||||
default: false,
|
||||
desc: "Pause before migrating database and restoring uploads"
|
||||
option :location, type: :string, enum: %w[local s3], desc: "Override the backup location"
|
||||
def restore(filename = nil)
|
||||
load_rails
|
||||
@ -179,6 +186,7 @@ class DiscourseCLI < Thor
|
||||
disable_emails: options[:disable_emails],
|
||||
location: options[:location],
|
||||
factory: BackupRestore::Factory.new(user_id: Discourse.system_user.id),
|
||||
interactive: options[:pause],
|
||||
)
|
||||
restorer.run
|
||||
puts "Restore done."
|
||||
|
Reference in New Issue
Block a user