Skip to content
This repository was archived by the owner on Nov 2, 2024. It is now read-only.

Commit 38517e4

Browse files
authored
docs/usage: add backup (#21)
* docs/usage: add backup * docs: fix ci * docs: some change
1 parent 24dbcd7 commit 38517e4

File tree

4 files changed

+55
-0
lines changed

4 files changed

+55
-0
lines changed

components/Icons/HistoryAlt.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { SVGProps } from "react";
2+
3+
export function UilHistoryAlt(props: SVGProps<SVGSVGElement>) {
4+
return (
5+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11.44,2A10,10,0,0,0,4.56,4.77V3a1,1,0,0,0-2,0V7.5a1,1,0,0,0,1,1H8.06a1,1,0,0,0,0-2H5.66A8,8,0,1,1,11.44,20a1,1,0,1,0,0,2,10,10,0,1,0,0-20Zm0,6a1,1,0,0,0-1,1v3a1,1,0,0,0,1,1h2a1,1,0,0,0,0-2h-1V9A1,1,0,0,0,11.44,8Z"/></svg>
6+
)
7+
}

pages/usage/_meta.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"serverless": "云函数",
99
"xlog": "xLog 集成",
1010
"search": "Algolia Search",
11+
"backup": "备份与回滚",
1112
"-- community": {
1213
"type": "separator",
1314
"title": "社区使用指南"

pages/usage/backup.mdx

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import { Callout } from "nextra/components";
2+
3+
# 备份与回滚
4+
5+
在 Mix Space 中内有备份功能,并且每日默认自动备份,数据无价请定期手动下载备份包。
6+
7+
## 备份
8+
9+
在后端中 其他 - 备份 中点击立即备份,即备份到绝对目录:
10+
11+
`~/mx-space/core/data/mx-space/backup/20xx-xx-xx_xx:xx:xx/backup-20xx-xx-xx_xx:xx:xx.zip`
12+
13+
## 自动备份
14+
15+
目前该功能仅支持备份到腾讯云 COS,暂不支持其他云服务。当然,你也可以通过设置计划任务等方法达到和此功能一样的效果。
16+
17+
设置入口:设定 - 系统 - 备份,填入 COS 对应参数即可。
18+
19+
## 回滚
20+
21+
<Callout type="error" emoji="⚠️">
22+
该操作涉及修改数据库,请多备份几个工作日的 backup,数据无价请谨慎操作!
23+
24+
一般情况下回滚只会导致 analyze 数据页丢失 IP & PV 的数据。
25+
</Callout>
26+
27+
<Callout type="info">
28+
Linux 和 macOS 可直接上传备份包,并且无需修改包名一致即可回滚,以下操作仅针对使用 Windows 用户访问后端回滚的情况。
29+
</Callout>
30+
31+
在后端中 其他 - 备份 中点击立即备份,将之前在电脑里的 `backup.zip` 上传到刚刚生成的备份目录里进行重命名替换。
32+
33+
34+
例:假如刚刚生成的备份是 backup-2022-09-01_23:33:33.zip 将想进行回滚的备份包 backup-2022-01-14_05:14:19.zip 修改为刚刚生成的备份一样的名字:
35+
36+
```bash
37+
mv ~/mx-space/core/data/mx-space/backup/2022-01-14_05:14:19/backup-2022-01-14_05:14:19.zip backup-2022-09-01_23:33:33.zip
38+
```
39+
40+
<Callout type="warning" emoji="⚠️">
41+
不要在 Windows 下重命名,Windows 不支持将英文冒号作为文件名的一部分
42+
</Callout>
43+
44+
替换完成会提示“数据库有变动,将在 x 秒后重载页面”,重载先检查文章评论等有没有丢失。
45+

pages/usage/index.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,15 @@ import { UilCloudDatabaseTree } from '@components/Icons/CloudDatabaseTree';
1717
import { UilLifeRing } from '@components/Icons/LifeRing';
1818
import { UilSearchAlt } from '@components/Icons/SearchAlt';
1919
import { UilBitcoin } from '@components/Icons/Bitcoin';
20+
import { UilHistoryAlt } from '@components/Icons/HistoryAlt';
2021

2122
<Cards num={3}>
2223
<Card icon={<UimMasterCard />} arrow href={"/usage/macros"} title="文本宏" />
2324
<Card icon={<UilCloudDatabaseTree />} arrow href={"/usage/serverless"} title="云函数" />
2425
<Card icon={<UilLifeRing />} arrow href={"/usage/bark"} title="Bark 通知 (WIP)" />
2526
<Card icon={<UilSearchAlt />} arrow href={"/usage/search"} title="Algolia Search" />
2627
<Card icon={<UilBitcoin />} arrow href={"/usage/xlog"} title="xLog 集成" />
28+
<Card icon={<UilHistoryAlt />} arrow href={"/usage/backup"} title="备份与回滚" />
2729
</Cards>
2830

2931
### 社区使用指南

0 commit comments

Comments
 (0)