Contrib backup/restore scripts#21971
Conversation
|
Thanks, @teletechie, for your contribution! Could you provide more details on this pull request?
|
|
@teletechie I assume these scripts are intended for Docker Compose only. I have a few general questions:
|
|
|
There was a problem hiding this comment.
Pull Request Overview
This PR introduces enhanced backup and restore scripts for Harbor to improve performance and error handling by leveraging rsync for faster file transfers and reducing downtime during operations. Key changes include:
- A new restore script (harbor-restore) that starts a temporary database container and restores the Harbor databases and associated data.
- An updated backup script (harbor-backup) that utilizes rsync and offers the option to create a tarball archive.
- Updated documentation in README.md to guide users on how to use these scripts.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| contrib/backup-restore/harbor-restore | New restore script managing database container setup and data restoration. |
| contrib/backup-restore/harbor-backup | New backup script using rsync with optional tarball creation. |
| contrib/backup-restore/README.md | Documentation update explaining usage, options, and prerequisites. |
|
i think the pr needs the label release-note/community but i can not see how to add it. |
| } | ||
|
|
||
| # Backup chart museum data | ||
| backup_chart_museum() { |
There was a problem hiding this comment.
please remove this part since the ChartMuseum has been deprecated for long time.
There was a problem hiding this comment.
i have changed the code to issue warnings when backing up or restoring chartmuseum data, but the script will still do the job. we are probably not the only ones having to still run one old harbor release for "that project" that hasn't yet moved out of chartmuseum. when syslog is enabled these warnings are also issued with warning level in syslog.
There was a problem hiding this comment.
I think we need to remove this part on chart_museum since it has been removed for several releases and we should not add any code relate with it.
|
This PR is being marked stale due to a period of inactivty. If this PR is still relevant, please comment or remove the stale label. Otherwise, this PR will close in 30 days. |
|
how do i get this moving again? |
|
@teletechie I’m generally okay with this script, thanks. One more question: since we don’t have prior experience with it and it hasn’t been validated in CI, could you provide the following support for community users who might rely on it? |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #21971 +/- ##
===========================================
+ Coverage 45.36% 65.86% +20.49%
===========================================
Files 244 1074 +830
Lines 13333 116355 +103022
Branches 2719 2931 +212
===========================================
+ Hits 6049 76636 +70587
- Misses 6983 35470 +28487
- Partials 301 4249 +3948
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
This PR is being marked stale due to a period of inactivty. If this PR is still relevant, please comment or remove the stale label. Otherwise, this PR will close in 30 days. |
|
how do i get the second review that is required? |
Signed-off-by: teletechie <cecilie.monsen@telenor.no>
Signed-off-by: teletechie <cecilie.monsen@telenor.no>
Signed-off-by: teletechie <cecilie.monsen@telenor.no>
Signed-off-by: teletechie <cecilie.monsen@telenor.no>
remove opening parenthesis in message. this matches the other messages Signed-off-by: teletechie <cecilie.monsen@telenor.no>
Fix the three docker calls so they enforce returning of status. remove unused if block that could never be triggered. Signed-off-by: teletechie <cecilie.monsen@telenor.no>
chartmuseum is deprecated. This change issues a warning when the backup detect chartmuseum data, but still backs it up. there is no message about not finding chartmuseum data if they don't exist. Signed-off-by: teletechie <cecilie.monsen@telenor.no>
chartmuseum is deprecated. this update issues a warning when detecting chartmuseum data in the restore, but will still restore the files. no message is given when chartmuseum data are not found. Signed-off-by: teletechie <cecilie.monsen@telenor.no>
9b4cce1 to
6cd1121
Compare
Thank you for contributing to Harbor!
Comprehensive Summary of your change
backup and restore scripts that are far more robust than the ones that used to exist in the project. These scripts also support much faster backups (using rsync instead of recursive cp) as well as use of rsync to copy the backup directory to a secondary node and then restore from that synced backup directory. Extremely short downtime compared to the old scripts.
Issue being fixed
Contributes upgraded/working backup and restore scripts
Please indicate you've done the following: