mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-09-30 06:16:37 +08:00
454542c1d0
- README 默认英文:README.en.md → README.md(英文为默认),中文移至 README.zh-CN.md,语言切换链接同步 - 恢复被删除的 docs/en/ 英文文档(git 历史 cc5e53c5^),删除 4 篇已废弃文件 - 英文导航 config.ts 对齐中文结构(新增 Deployment/Changelog 侧栏,同步 Guide/Design 条目) - 翻译 15 篇中文新增文档:guide 5 篇(certificates/pages-usage/proxy-config/uptime-kuma/zone-domain-migration)+ design 10 篇(zone-design/cloudflare-pointing/waf-orchestration/origin-error-page/edge-cache-design/pages-design/logstore/kuma-design/login-captcha/observability 三篇) - en 首页更新(新增 Pages 特性、tagline 同步);changelog 英文入口指向中文版 - vitepress 构建验证:43 个英文页面全部渲染 注意:29 篇旧英文文档为恢复版,部分内容(如 deployment/server、reference/configuration)可能落后于中文,需后续逐篇同步
53 lines
2.9 KiB
Markdown
53 lines
2.9 KiB
Markdown
# Zone Domain Migration and Release Acceptance
|
|
|
|
When migrating from the legacy `managed_domains` / inline domain columns of reverse proxy routes to the Zone + Zone Domain model, data import and table structure upgrades are both completed by the **automatic goose migration at Server startup** — no separate import command is needed.
|
|
|
|
## What Happens During Upgrade
|
|
|
|
When starting (or rolling-upgrading) a Server version that includes the Zone rework, **no manual command is required**; `migrator.Migrate()` automatically:
|
|
|
|
1. Applies goose SQL: creates `of_zones` / `of_zone_domains` (if they do not yet exist).
|
|
2. **Automatically imports** the legacy route domain columns (and `of_managed_domains` when routes have no domains) as Zone / Zone Domains, binding `proxy_route_id` / `cert_id` (registering root domains via public suffix list parsing).
|
|
3. Continues goose SQL: drops the redundant domain/certificate columns from `of_managed_domains` and `of_proxy_routes`.
|
|
|
|
The import is idempotent: existing domains are skipped or have their route binding back-filled.
|
|
|
|
**If historical data cannot be parsed (conflicting domains, invalid root domains, missing certificates, etc.), startup fails.** Fix the data or restore a backup and start again to retry.
|
|
|
|
## Recommended Actions
|
|
|
|
### 1. Back Up Before Upgrading
|
|
|
|
```bash
|
|
# PostgreSQL example
|
|
pg_dump "$DATABASE_URL" > openflare-pre-zone-$(date +%Y%m%d).sql
|
|
|
|
# Or copy the backup volume / snapshot; for SQLite, copy the database file in the data directory
|
|
```
|
|
|
|
Optional: note down the current **active config version number** and checksum in the admin panel for config rollback comparison.
|
|
|
|
### 2. Upgrade and Start the Server
|
|
|
|
Deploy the new version and start it. Watch the goose success messages in the startup log; if "Zone migration failed (N conflicts)" appears, fix the source data according to the conflicts listed in the log and restart.
|
|
|
|
### 3. Post-Upgrade Checks
|
|
|
|
1. Admin panel **Websites** `/websites`: check whether Zone root domains and domain counts are reasonable.
|
|
2. Zone details: domains, certificates, associated route IDs.
|
|
3. **Reverse proxy routes**: domain bindings come from Zone Domains, not legacy hand-written fields.
|
|
|
|
### 4. Config Preview and Release
|
|
|
|
1. Review the config diff / preview in the admin panel.
|
|
2. Verify **per route**: `server_name` set, certificate paths, WAF Route ID, Pages references.
|
|
3. **Allow** the redundant `domain` / `domains` / `cert_ids` on routes in old snapshot JSON to disappear.
|
|
4. **Do not allow** data-plane semantic changes.
|
|
5. After the preview passes, release it; if needed, activate the pre-upgrade version in config versions for config rollback. For database rollback, use the pre-upgrade backup (down migrations do not backfill business domain data).
|
|
|
|
## Related Docs
|
|
|
|
* [Zone & Domain Resource Design](../design/zone-design.md)
|
|
* [Create a Reverse Proxy Config](./proxy-config.md)
|
|
* [Publish First Configuration](./first-site.md)
|