Skip to content
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

Support backup and restore #4206

Merged
merged 47 commits into from Jul 24, 2023

Conversation

JohnNiang
Copy link
Member

@JohnNiang JohnNiang commented Jul 12, 2023

What type of PR is this?

/kind feature
/area core

What this PR does / why we need it:

See https://github.com/JohnNiang/halo/blob/9921deb0768cb22fb4ba738e20fdc099f1678926/docs/backup-and-restore.md for more.

image image

Which issue(s) this PR fixes:

Fixes #4059
Fixes #3274

Special notes for your reviewer:

Does this PR introduce a user-facing change?

支持备份和恢复功能。

@f2c-ci-robot f2c-ci-robot bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. labels Jul 12, 2023
@f2c-ci-robot f2c-ci-robot bot added the area/core Issues or PRs related to the Halo Core label Jul 12, 2023
@ruibaby ruibaby added this to the 2.8.x milestone Jul 15, 2023
@ruibaby
Copy link
Member

ruibaby commented Jul 16, 2023

发现一个小问题,恢复的时候会同时恢复 docker-compose.yaml 文件,会导致重启的出现异常。我的步骤:

  1. 备份源是使用 PostgresSQL 数据库,并使用 Docker Compose。
  2. 恢复时使用的 Docker Compose + 默认的 H2 数据库。
  3. 正常恢复之后提示重启,但是在重启的时候发现 docker-compose.yaml 被恢复成以前的,所以导致数据库配置不正确。

@JohnNiang
Copy link
Member Author

发现一个小问题,恢复的时候会同时恢复 docker-compose.yaml 文件,会导致重启的出现异常。我的步骤:

  1. 备份源是使用 PostgresSQL 数据库,并使用 Docker Compose。
  2. 恢复时使用的 Docker Compose + 默认的 H2 数据库。
  3. 正常恢复之后提示重启,但是在重启的时候发现 docker-compose.yaml 被恢复成以前的,所以导致数据库配置不正确。
  1. 将 docker-compose.yaml 配置放入 Halo 的工作目录本身是不合理的。
  2. 但是不合理的事情已经发生了,所以后面我将尝试忽略以下根目录文件或文件夹:
    • docker-compose.yaml
    • docker-compose.yml
    • mysql/**
    • mysqlBackup/**
    • db/**

Copy link
Member

@ruibaby ruibaby left a comment

Choose a reason for hiding this comment

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

/lgtm

@f2c-ci-robot f2c-ci-robot bot added the lgtm Indicates that a PR is ready to be merged. label Jul 20, 2023
@f2c-ci-robot f2c-ci-robot bot removed the lgtm Indicates that a PR is ready to be merged. label Jul 21, 2023
@guqing
Copy link
Member

guqing commented Jul 21, 2023

备份列表排序是否需要按时间降序排列
image

@guqing
Copy link
Member

guqing commented Jul 21, 2023

建议恢复时增加一个状态,否则文件上传完成后中间恢复期间没有状态如果时间过长用户不知道到底恢复好没有
同时可以将文件上传完毕的文字提示改为已恢复
image

@ruibaby
Copy link
Member

ruibaby commented Jul 21, 2023

建议恢复时增加一个状态,否则文件上传完成后中间恢复期间没有状态如果时间过长用户不知道到底恢复好没有
同时可以将文件上传完毕的文字提示改为已恢复

现在无法得知是否上传完毕还是正在迁移,只有一个接口。如果要改,也只能改上传组件的文字,统一改为恢复中。

@JohnNiang
Copy link
Member Author

备份列表排序是否需要按时间降序排列 image

等待 PR #4274 合并,并适配。

@ruibaby
Copy link
Member

ruibaby commented Jul 24, 2023

备份列表排序是否需要按时间降序排列 image

等待 PR #4274 合并,并适配。

已支持。

Signed-off-by: Ryan Wang <i@ryanc.cc>
Signed-off-by: Ryan Wang <i@ryanc.cc>
@f2c-ci-robot f2c-ci-robot bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 24, 2023
@f2c-ci-robot f2c-ci-robot bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 24, 2023
Copy link
Member

@ruibaby ruibaby left a comment

Choose a reason for hiding this comment

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

/lgtm

@f2c-ci-robot f2c-ci-robot bot added the lgtm Indicates that a PR is ready to be merged. label Jul 24, 2023
Copy link
Member

@guqing guqing left a comment

Choose a reason for hiding this comment

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

/approve
NIUBI 🎉

@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Jul 24, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: guqing

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@f2c-ci-robot f2c-ci-robot bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 24, 2023
@JohnNiang
Copy link
Member Author

/meow

@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Jul 24, 2023

@JohnNiang: cat image

In response to this:

/meow

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@f2c-ci-robot f2c-ci-robot bot merged commit bd912c3 into halo-dev:main Jul 24, 2023
4 checks passed
@JohnNiang JohnNiang deleted the feat/backup-and-restore branch July 24, 2023 08:26
@ruibaby ruibaby modified the milestones: 2.8.x, 2.8.0 Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/core Issues or PRs related to the Halo Core kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

期望提供数据库&全站迁移/转换/备份功能 期望提供备份和恢复功能
3 participants