Skip to content

FEATURE: Add utilities for importing and exporting backups #32992

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

nbianca
Copy link
Member

@nbianca nbianca commented May 29, 2025

This commit introduces two new utilities related to the backup and
restore system that make use of remote URLs:

  • discourse export_backup generates a URL of a backup file

  • discourse import_backup downloads a backup file from a URL to the
    configured backup store

This can be used to move content between two Discourse instances by
backing up the entire site, exporting the backup, importing it on the
other instance and restoring it.

@nbianca nbianca marked this pull request as draft May 30, 2025 07:50
@nbianca nbianca changed the title Add utilities for backups and remote URLs FEATURE: Add utilities for backups and remote URLs Jun 2, 2025
@nbianca nbianca marked this pull request as ready for review June 3, 2025 20:10
This commit introduces two new utilities related to the backup and
restore system that make use of remote URLs:

- `discourse export_backup` generates a URL of a backup file

- `discourse import_backup` downloads a backup file from a URL to the
  configured backup store

This can be used to move content between two Discourse instances by
backing up the entire site, exporting the backup, importing it on the
other instance and restoring it.
@nbianca nbianca changed the title FEATURE: Add utilities for backups and remote URLs FEATURE: Add utilities for importing and exporting backups Jun 4, 2025
nbianca added 2 commits June 5, 2025 11:17
This commit amends the current implementation of `BackupRestore::Restorer`
to accept a URL to a backup file, that is downloaded and then restored.
@nbianca nbianca requested a review from tgxworld June 5, 2025 21:28
@@ -16,6 +16,18 @@ def ==(other)
attributes == other.attributes
end

def self.download(url)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe BackupRestore::BackupFileHandler.download(url) instead? Putting it in the model doesn't seem like the right place.

Copy link
Contributor

@tgxworld tgxworld left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants