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

[Feature] Can database backup store files according to tables? #7691

Open
cktk opened this issue Jan 10, 2025 · 5 comments
Open

[Feature] Can database backup store files according to tables? #7691

cktk opened this issue Jan 10, 2025 · 5 comments
Assignees

Comments

@cktk
Copy link

cktk commented Jan 10, 2025

1Panel Version

v1.10.22-lts

Please describe your needs or suggestions for improvements

背景 我某个库中有几个表特别大 导致整体备份文件就大
有些时候同事手抖 把某条数据给删了 因为关联着好多表 希望我能给恢复一下这几张表的数据

Please describe the solution you suggest

在现有的基础上
备份一个数据库会生成一个压缩包
在压缩包中可否按照每张表一个文件来存储 这样我手动下载下来备份包手动解压 恢复也是很方便的 毕竟1个多G的文件读取下载都很费劲
db_xx.sql.gz
表1.sql
表2.sql
表3.sql
如果希望做的更好一些可以db_xx.sql.gz 改成文件夹 这样恢复的时候从oss中下载的话就下载一部分 而不是全部了
是否可以加上忽略那几张表的备份 有些时候的logs表没有价值 还很大备份的时候还备份了

Additional Information

No response

@wanghe-fit2cloud wanghe-fit2cloud changed the title [Feature] 数据库备份能否按照表来存储文件 [Feature] Can database backup store files according to tables? Jan 10, 2025
@wanghe-fit2cloud
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


1Panel Version

v1.10.22-lts

Please describe your needs or suggestions for improvements

Background: There are several tables in one of my libraries that are extremely large, causing the overall backup file to be very large.
Sometimes my colleagues’ hands are shaking and they delete a certain piece of data because it is related to many tables. I hope I can restore the data in these tables.

Please describe the solution you suggest

on the basis of existing
Backing up a database will generate a compressed package
Can each table be stored as one file in the compressed package? It would be very convenient for me to manually download the backup package and decompress it manually. After all, it is very difficult to read and download a file of more than 1G.
db_xx.sql.gz
Table 1.sql
Table 2.sql
Table 3.sql
If you want to do better, you can change db_xx.sql.gz into a folder. In this way, if you download it from oss during recovery, you can download part of it instead of all of it.
Is it possible to add a backup that ignores those tables? Sometimes the logs table is worthless and even when the backup is very large, it is also backed up.

Additional Information

No response

@wanghe-fit2cloud
Copy link
Member

感谢反馈,我们会在后续版本考虑支持上述需求。

@cktk
Copy link
Author

cktk commented Jan 10, 2025

感谢反馈,我们会在后续版本考虑支持上述需求。

比较好实现的一个就是 备份的时候 直接按照表名生成.sql文件 恢复的时候 直接读取列表 一个个进行执行 现在这个备份有点太大了 找数据找的我头皮发麻

@wanghe-fit2cloud
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Thanks for the feedback, we will consider supporting the above requirements in subsequent versions.

One of the better implementations is to directly generate the .sql file according to the table name when backing up. When restoring, directly read the list and execute it one by one. Now this backup is a bit too big, and my scalp is numb when looking for data.

@wanghe-fit2cloud
Copy link
Member

感谢反馈,我们会在后续版本考虑支持上述需求。

比较好实现的一个就是 备份的时候 直接按照表名生成.sql文件 恢复的时候 直接读取列表 一个个进行执行 现在这个备份有点太大了 找数据找的我头皮发麻

后续可能会考虑增加 表备份 这个独立的功能。

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

No branches or pull requests

2 participants