pfaffman
(Jay Pfaffman)
April 15, 2019, 7:15pm
2
Ahh! I think that I’ve seen that but thought it was my imagination.
I can’t tell when the feature got added, but if you don’t want to disable emails, it can be set via an option, but by default it set disable_email to “non-staff”.
end
filename_without_extension = File.basename(filename).sub(/\.(sql\.)?(tar\.gz|t?gz)$/i, "")
end
old_include_s3_uploads_in_backups = SiteSetting.include_s3_uploads_in_backups
SiteSetting.include_s3_uploads_in_backups = true if !options[:sql_only] && options[:s3_uploads]
begin
puts "Starting backup..."
creator =
BackupRestore::Creator.new(
Discourse.system_user.id,
filename: filename_without_extension,
with_uploads: !options[:sql_only],
)
backup_filename = creator.run
exit(1) unless creator.success
puts "Backup done."
@user_id = user_id
@filename = filename
@factory = factory
@logger = factory.logger
@disable_emails = disable_emails
@interactive = interactive
ensure_restore_is_enabled
ensure_we_have_a_user
ensure_we_have_a_filename
@success = false
@current_db = RailsMultisite::ConnectionManagement.current_db
@system = factory.create_system_interface
@backup_file_handler = factory.create_backup_file_handler(@filename, @current_db, location)
@database_restorer = factory.create_database_restorer(@current_db)
@uploads_restorer = factory.create_uploads_restorer
end
def run
This is a fantastic feature. It is pretty rare that I want to restore a backup and have it immediately start spewing mail.
5 Likes