Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/en/guide/backup-upgrade.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ Back up together:

Schedule a maintenance window. Stop BDS and db-server, verify both processes have exited, and then archive the assets above to a location outside the instance. Include the actual database path if it is outside `data/`; do not assume the BDS directory is named `BedrockDedicatedServer`.

Check `modules/packages/` for symlinks or Windows junctions first. Archiving `modules/` alone may omit their targets: an isolated `Compress-Archive` check on Windows included ordinary files but skipped the junction's contents. Record each link and target, archive the actual source directories separately, and verify that both content and links can be restored. A dangling link is not a backed-up module. The simple archive examples in the Chinese guide apply only when the module directory has no links.

Do not copy a live SQLite database while it may have uncheckpointed WAL data:

```bash
Expand Down
6 changes: 6 additions & 0 deletions docs/zh/dev/stable-release-plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,9 @@
3. 从冷备份恢复至隔离副本,对**真实历史数据副本**演练正式版升级、数据库迁移、模块组装与部署;检查 SQLite 完整性、关键配置兼容和启动日志。再恢复原备份到隔离副本,确认回退后可启动。任何失败先修复或终止本次生产升级。
4. 仅在演练通过后,按实际安装方式用 pnpm 将目标实例升级到已发布版本;按需升级当前启用的模块,构建并部署行为包。不要在同一窗口顺带升级 BDS 核心。启动服务,核对新的 BDS/db/QQ 日志、部署 catalog 与目标版本,并检查玩家和机器人关键路径。
5. 若启动或数据检查失败,保持停机,从同一份冷备份恢复平台运行时、配置、数据库、模块与世界包,再启动旧版复核。记录实际回退耗时和结果。此前用户要求跳过的客户端绑定、踢人及 QQ 实际投递仍需另行实测,未测不得勾选对应门槛。

### 维护窗口前只读核对(2026-09-28)

- 正式服 BDS `1.26.51.1` 仍在运行,未执行停机或部署。`modules/packages/` 下 21 个目录均为指向源码的 junction,其中 19 个官方模块的 `package.json` 版本号与已发布版本一致,但版本号不能证明源码内容与 npm tarball 相同;另有两个本地模块,须保留其源码与链接关系。
- 一个本地模块 junction 的目标不存在,`modules/sdk` 的目标也不存在。正式服当前运行的已部署包不能证明这些源码链接可用于下一次构建。维护窗口内升级前必须核实并处理这些链接,不能直接批量 `mod install` 覆盖或删除链接。
- 对隔离目录中的 junction 做备份验证:`Compress-Archive` 的归档保留普通 `catalog.json`,却没有收录 junction 指向的 `marker.txt`。因此仅压缩 `modules/` 不能作为此正式服的完整冷备份;需要显式归档各链接目标并做恢复演练,备份指南已加阻断检查。
30 changes: 20 additions & 10 deletions docs/zh/guide/backup-upgrade.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,28 @@ sfmc> /stop -all
### 执行打包归档
使用系统原生打包工具将关键资产压缩为带时间戳的归档。下面的 `BDS_DIR` / `$bdsDir` 必须先替换为当前实例实际的 BDS 目录;不要假定目录名为 `BedrockDedicatedServer`。归档须放在被备份目录之外,且空间足够。若数据库位于 `data/` 之外,应另行纳入。

**先检查 `modules/packages/` 是否含符号链接或 Windows junction。** 归档 `modules/` 不等于备份链接目标:本机用 `Compress-Archive` 对 junction 的隔离验证中,归档只包含普通文件,漏掉了链接模块的内容。若存在链接,应逐个记录模块名与目标路径,确认目标可访问,并将实际源码目录另行归档;恢复演练时要连同链接关系一起验证。目标已丢失的链接应先查明原因,不能把它记作已备份。下面的简例仅适用于模块目录内没有链接的实例。

<Tabs>
<Tab label="Linux (Bash)">

```bash
BDS_DIR=/path/to/your/BDS
BACKUP_DIR=/path/outside/SFMC_ROOT
mkdir -p "$BACKUP_DIR"
# 在 SFMC_ROOT 下运行
tar -czvf "$BACKUP_DIR/backup-sfmc-$(date +%Y%m%d_%H%M%S).tar.gz" \
data/ \
configs/ \
modules/ \
packs/ \
"$BDS_DIR/worlds" \
"$BDS_DIR/behavior_packs" \
"$BDS_DIR/resource_packs"
if [ -n "$(find modules/packages -mindepth 1 -maxdepth 1 -type l -print -quit)" ]; then
echo "modules/packages contains links; back up each target separately" >&2
else
mkdir -p "$BACKUP_DIR"
# 在 SFMC_ROOT 下运行
tar -czvf "$BACKUP_DIR/backup-sfmc-$(date +%Y%m%d_%H%M%S).tar.gz" \
data/ \
configs/ \
modules/ \
packs/ \
"$BDS_DIR/worlds" \
"$BDS_DIR/behavior_packs" \
"$BDS_DIR/resource_packs"
fi
```

</Tab>
Expand All @@ -61,6 +67,10 @@ tar -czvf "$BACKUP_DIR/backup-sfmc-$(date +%Y%m%d_%H%M%S).tar.gz" \
```powershell
$bdsDir = "D:\path\to\your\BDS" # 改为实际目录
$backupDir = "D:\path\outside\SFMC_ROOT" # 改为实际备份目录
$linkedModules = @(Get-ChildItem -LiteralPath modules\packages -Force | Where-Object { $_.LinkType })
if ($linkedModules.Count -gt 0) {
throw "modules/packages 包含链接;请先逐个备份目标目录并验证恢复,不能只压缩 modules/"
}
New-Item -ItemType Directory -Path $backupDir -Force | Out-Null
$timestamp = Get-Date -Format "yyyyMMdd_HHmmss"
Compress-Archive -LiteralPath data, configs, modules, packs, `
Expand Down
Loading