版本升级时自动备份数据到指定目录,按「主.次」版本号滚动保留
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
Research direction
Read the startup flow around main.py:278 and Config.init_config(), then inspect app/services/data_backup.py and the existing export behavior referenced by #434. The issue calls for recording the prior version and backing up before configuration migrations; done means upgrades create a backup, retain files according to the stated version rules without touching unrelated files, and show the required success or failure notice.
Written by the indexing model from the issue text.
Description
在提问之前...
- 我确认这是需求建议,而不是 Bug 反馈
- 我已搜索过活跃议题与已关闭议题,确认该需求未被提出过
需求描述
MAS 版本号变化时,自动把数据备份到用户指定的目录:
- 在设置里选好备份目录(建议放在安装目录外)后开启;备份内容与现有「导出数据备份」(#434)相同。
- 只写不读:不自动恢复,不碰源数据。清理时只删自己生成的备份文件(按文件名规则识别),目录里的其他文件一律不动。新备份写完后才清理旧的,写失败就不删任何文件。
- 保留规则:按备份时旧版本号的前两位
主.次分段(beta 也算在同一段,5.6.0-beta.1属于 5.6)。- 升到 X.Y 时只留 X.Y 本段和上一段,更早的删掉:升到 5.6 时删 5.4.x,5.5.x 留到升 5.7 时再删。
- 「上一段」按
(主, 次)取现有备份里比当前段小的最大那一段,不拿次版本号减一:升到 6.0 时上一段是 5.x 的最后一段,跨版本直升(5.4 → 5.7)时上一段就是 5.4。 - 不管上面两条,最新两份永远保留。
- 备份完成后提示一句:自动备份每两个次版本滚动删除一次,如需每个版本都留一份,请在设置里手动导出。
想解决什么问题
升级出问题时(如 beta.6 首版),现在只能靠用户升级前记得手动导出。
你设想的方案
触发点放在新版本启动、Config.init_config() 之前(main.py:278;check_data() 和各配置文件的 load() 迁移都在里面跑):拿上次运行记录的版本号比对(目前还没有这项记录,要新增),不一样就先调 create_data_backup()(app/services/data_backup.py)备份。这样安装包、源码拉取、手动覆盖安装这几条升级路径都能兜住。备份失败不阻断启动,但要在界面上提示。
- Dominant language
- Python
- Stars
- 707
- Forks
- 56
- Avg merge
- 11h 45m
- Merged PRs (30d)
- 429
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from AUTO-MAS-Project/AUTO-MAS
-
AI bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
AUTO-MAS-Project/AUTO-MAS#1960 · 1 comment ·
Maintainers usually reply within 1 day
-
AI bug
Difficulty 4/5 3-5 days Newbie friendliness 48/100
AUTO-MAS-Project/AUTO-MAS#1959 · 1 comment ·
Maintainers usually reply within 1 day
-
AI bug
Difficulty 3/5 1-2 days Newbie friendliness 66/100
AUTO-MAS-Project/AUTO-MAS#1956 · 1 comment ·
Maintainers usually reply within 1 day
-
AI bug
Difficulty 4/5 3-5 days Newbie friendliness 55/100
AUTO-MAS-Project/AUTO-MAS#1953 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 67/100
AUTO-MAS-Project/AUTO-MAS#1947 ·
Maintainers usually reply within 1 day
All issues in AUTO-MAS-Project/AUTO-MAS
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
btclib-org/btclib-wallet#872 ·
Maintainers usually reply within 1 day
-
[Bug]: Scheduled returns scan all accepted minion keys causing extreme loadPossibly taken A pull request linked to this issue is open or already merged. Openbug needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
saltstack/salt#70789 · 1 comment ·
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 87/100
btclib-org/btclib#3093 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
patrickballard/wheelgap#269 ·