migration-planning
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMigration planning
迁移规划
Guide the migration from understanding the existing system through implementation, controlled transition, and legacy retirement. The central interaction is reasoning with the user about what changes, its impact, which strategy fits, and why.
指导迁移从理解现有系统开始,贯穿实施、受控过渡,直至旧系统退役。核心协作是与用户共同推演:哪些内容会发生变化、会产生什么影响、哪种策略适用,以及为什么适用。
Establish the migration
确立迁移基础
Identify the current system, destination, reason for migrating, affected users and capabilities, and authorized scope: investigation, planning, implementation, operation, or the complete lifecycle. A planning request authorizes planning; existing authorization for further work remains sufficient within its scope.
Translate the reason into an observable outcome and baseline: deployment autonomy, operating cost, capacity, reliability, or time to change. Define behavior to preserve, obsolete capabilities to retire, and intentional changes with the user; use the legacy system as evidence of behavior rather than an unquestioned specification. Prioritize the first slice by expected value, risk, coupling, and available operational capacity.
Read the repository's domain, architecture, testing, deployment, feature-flag, and issue-tracking guidance. Follow its conventions for recording work, readiness, relationships, and decisions. Missing recording guidance is a publication gap; continue independent design and implementation work that is authorized.
Inspect code, configuration, architectural decisions, existing migration work, and operational evidence. Establish behavior, interfaces, data ownership, deployment paths, and failure modes. Distinguish current production evidence from local tests, historical notes, and assumptions.
Inventory consumers for each capability: application flows, background jobs, queues, scheduled work, integrations, and older clients. Use available corporate search, service catalogs, relevant repositories, documentation, and responsible teams to discover dependencies beyond the local codebase. Corroborate discovery with runtime evidence where available. Track each consumer's disposition and ownership or usage gaps through transition and retirement. Absence of search results is not proof of disuse.
Discovery is sufficient to choose the first slice when its boundary, intended result, behavior to preserve, known consumers and prerequisites, and material unknowns are identified. Unknowns that affect its design or safe exposure remain explicit prerequisites.
确定当前系统、目标系统、迁移原因、受影响的用户和能力,以及授权范围:调查、规划、实施、运营或完整生命周期。规划请求仅授权规划;在既有授权范围内,对后续工作的现有授权仍然有效。
将迁移原因转化为可观测的结果和基线:部署自主性、运营成本、容量、可靠性或变更耗时。与用户共同定义需要保留的行为、应退役的过时能力以及有意进行的变更;应将旧系统作为行为证据,而不是未经质疑的规范。根据预期价值、风险、耦合程度和可用运维能力,确定优先实施的第一切片。
阅读代码仓库中关于领域、架构、测试、部署、feature flag 和问题跟踪的指南。遵循代码仓库关于记录工作、就绪状态、关系和决策的约定。如果缺少记录指南,则视为文档发布缺口;在已获授权的情况下,继续独立开展设计和实施工作。
检查代码、配置、架构决策、现有迁移工作和运营证据。确定行为、接口、数据所有权、部署路径和故障模式。区分当前生产环境的证据与本地测试、历史记录和假设。
为每项能力盘点使用方:应用流程、后台作业、队列、定时任务、集成和旧客户端。使用可用的企业搜索、服务目录、相关代码仓库、文档和负责团队,发现本地代码库之外的依赖。在可行处,使用运行时证据对发现结果进行交叉验证。跟踪每个使用方的处置状态、所有权或使用情况缺口,直至过渡和退役完成。没有搜索结果并不能证明其已不再使用。
当第一切片的边界、预期结果、需保留的行为、已知使用方和前置条件以及实质性未知项均已确定时,即可认为探索已足够支持选择该切片。任何会影响其设计或安全开放情况的未知项,仍须作为明确的前置条件保留。
Choose and explain the strategy
选择并解释策略
Use Strangler Fig as the preferred approach: preserve the active path while building an alternative behind a replaceable boundary, then migrate bounded capabilities. Use feature flags and canaries for controlled activation. Choose gradual cohorts or a controlled switch according to the capability.
Prefer vertical slices whenever feasible: migrate one complete user journey, business capability, or representative traffic path through the necessary interface, behavior, data, and operations. Make each slice independently exposable, observable, and recoverable so it can deliver value and test migration assumptions before the next slice. If coupling prevents this, identify the smallest enabling work and explain how it leads to the first vertical slice.
Always consider routing affinity by user or organization, versioned contracts, backward-compatible evolution, staged read/write migration, and synchronization or replication. Select or combine them for the actual boundary, explaining material limitations or inapplicability. Affinity preserves destination choice; compatible contracts preserve interoperability; replication preserves specified data availability and consistency. Each addresses a different part of continuity.
For application decomposition or replacement behind a new boundary, read boundaries and transitional architecture. Justify what separates and what stays together, including remaining execution, data, and deployment coupling. Define temporary transition mechanisms, their cost and ownership, and conditions for removal.
Conduct a collaborative investigation through progressive decisions. Use this cycle in the user's language, with descriptive work names:
- Investigate available repository and operational evidence before asking for facts it can establish. Ask for missing goals, constraints, preferences, or decisions that materially affect the next action; continue independent investigation while awaiting answers.
- Present a working hypothesis: what will migrate, which benefit it should deliver, and what must be preserved. Distinguish evidence from assumptions and incorporate corrections.
- Select the next consequential unresolved decision. Explain today's flow and the intended flow, including what changes and remains shared. Compare viable alternatives and recommend one with its impact, costs, assumptions, and uncertainty. Explain named patterns in the project's terms.
- Test the recommendation through a concrete normal journey and a failure scenario: where operations run, read and write, how their destination is selected, and how recovery works. Investigate consequences that could invalidate the recommendation and resolve interpretations that would change the design.
- Consolidate the decision, rationale, assumptions, missing evidence, advancement conditions, and triggers for reconsideration using repository conventions. Carry accepted corrections through the plan, implementation, and validation.
Discuss one unresolved topic at a time. Reuse established answers and existing authorization rather than repeatedly requesting confirmation. Shared vocabulary alone does not establish shared understanding; concrete scenarios should expose meaningful differences. Repeat the cycle until the next slice can proceed, then revisit later decisions when relevant evidence becomes available.
This stage is complete for a slice when its expected benefit, boundary, affected journeys, selected strategy and rationale, intermediate states, data authority, continuity measures, recovery approach, and unresolved decisions are explicit. Resolve decisions required for the next action; retain later uncertainties as visible gates.
优先采用 Strangler Fig 模式:在保留当前活跃路径的同时,在可替换边界之后构建替代方案,然后逐项迁移边界明确的能力。使用 feature flag 和 canary 实现受控启用。根据具体能力,选择渐进式用户分组或受控切换。
尽可能优先采用垂直切片:迁移一条完整的用户旅程、业务能力或代表性流量路径,并涵盖必要的接口、行为、数据和运营。让每个切片都能独立开放、观测和恢复,从而在进入下一切片前交付价值并验证迁移假设。如果耦合关系阻碍这种方式,应找出最小的使能工作,并说明它如何促成首个垂直切片。
始终考虑基于用户或组织的 routing affinity、版本化契约、向后兼容演进、分阶段读写迁移,以及同步或复制。根据实际边界选择或组合这些方案,并说明其重大限制或不适用之处。routing affinity 保持目标选择的一致性;兼容契约保持互操作性;复制则保持指定的数据可用性和一致性。它们分别解决连续性的不同方面。
对于在新边界之后拆分或替换应用程序,请阅读 边界与过渡架构。论证哪些内容应分离、哪些应保持在一起,包括仍然存在的执行、数据和部署耦合。定义临时过渡机制、其成本与所有权,以及移除条件。
通过渐进式决策开展协作式调查。按照下述循环,使用用户的语言并采用描述性的工作项名称:
- 在询问代码仓库和运营证据能够自行确认的事实之前,先调查这些证据。仅询问缺失且会实质影响下一步行动的目标、约束、偏好或决策;等待答复期间,继续独立调查。
- 提出工作假设:将迁移什么、应带来什么收益、必须保留什么。区分证据与假设,并纳入纠正意见。
- 选择下一个影响重大的未决决策。说明当前流程和目标流程,包括哪些内容会变化、哪些内容仍共享。比较可行备选方案,并推荐一种方案,同时说明其影响、成本、假设和不确定性。使用项目自身的术语解释所命名的模式。
- 通过一个具体的正常旅程和一个故障场景检验推荐方案:操作在哪里运行、在哪里读写、如何选择目标端,以及如何恢复。调查可能使推荐方案失效的后果,并解决会改变设计的不同解读。
- 按照代码仓库约定,汇总决策、理由、假设、缺失证据、推进条件以及重新评估的触发因素。将已接受的纠正贯穿到计划、实施和验证中。
每次只讨论一个未决主题。复用已确定的答案和现有授权,而不是反复请求确认。仅有共同词汇并不能建立共同理解;具体场景应揭示有意义的差异。重复此循环,直到下一切片可以推进;之后在相关证据出现时再重新审视后续决策。
当某个切片的预期收益、边界、受影响旅程、所选策略及理由、中间状态、数据权威源、连续性措施、恢复方案和未决决策均已明确时,该切片的此阶段即告完成。解决下一步行动所必需的决策;将后续不确定性保留为可见的关卡。
Design coexistence and recovery
设计共存与恢复
No visible user interruption is the default acceptance requirement. Define continuity for the affected journeys: availability, latency, session state, successful actions, and data correctness. Preserve it during coexistence, transition, recovery, and retirement. A deliberately accepted scream test can temporarily interrupt consumers; use the retirement procedure below for that exception.
Specify selection of old and new paths, coherence for the necessary lifetime, compatibility across versions, and treatment of in-flight and background work. Prefer stable canary assignment by user identity across journeys and return visits. When designing assignment, routing-policy overrides, or flag-service failure behavior, read routing and recovery.
Keep a tested return path until final migration acceptance, before agreed legacy retirement. This is expected for large migrations and preferred for small ones. For a small migration, recovery through new corrective work is an exceptional alternative requiring explicit acceptance of the point of no return, recovery work, and consequences. That exception preserves the default continuity requirement. Every recovery strategy must preserve valid user activity produced after activation.
Prefer one authoritative writer per datum or capability at each stage. Authority can stay with the old path or transfer by capability; define its owner and transfer conditions. Independent authoritative writes on both sides require a concrete need and an explained conflict-detection, resolution, and recovery strategy. Replication of one authoritative change is distinct from independent authority.
When changing persisted data, evolving an incompatible interface, or dividing a transactional workflow, read contracts, data, and business recovery. For application decomposition, define contracts, ownership, authentication, and cross-boundary dependencies. For hosting changes, cover all affected traffic types and deployed-version compatibility.
Identify who operates the destination and sustains coexistence, including deployment access, monitoring, recovery responsibility, and capacity for running both paths. Resolve missing operational ownership before exposure.
默认验收要求是不造成用户可见中断。 为受影响的旅程定义连续性:可用性、延迟、会话状态、成功完成操作的能力和数据正确性。在共存、过渡、恢复和退役期间保持这些属性。若明确接受 scream test,可临时中断使用方;应将此类例外纳入下述退役流程。
指定旧路径和新路径的选择方式、必要生命周期内的一致性、跨版本兼容性,以及对进行中工作和后台工作的处理。优先按用户身份为 canary 分组,并在不同旅程和回访之间保持分组稳定。设计分组方式、路由策略覆盖或 flag 服务故障行为时,请阅读 路由与恢复。
在最终迁移验收之前、也就是约定的旧系统退役之前,保留经过测试的回退路径。对于大型迁移,这是预期做法;对于小型迁移,也是首选做法。对于小型迁移,通过新的纠正性工作进行恢复是一种例外方案,必须明确接受不可逆点、恢复工作及其后果。该例外仍须满足默认的连续性要求。每种恢复策略都必须保留启用后新路径产生的有效用户活动。
每个阶段中,每项数据或能力优先只设一个权威写入方。权威可以保留在旧路径,也可以按能力转移;应定义其所有者及转移条件。两侧进行相互独立的权威写入必须有明确需求,并配套说明冲突检测、解决和恢复策略。复制单一权威变更不同于两侧各自拥有写入权威。
更改持久化数据、演进不兼容接口或拆分事务工作流时,请阅读 契约、数据与业务恢复。对于应用程序拆分,应定义契约、所有权、身份验证和跨边界依赖。对于托管环境变更,应涵盖所有受影响的流量类型和已部署版本兼容性。
确定由谁运营目标端并维持共存运行,包括部署访问权限、监控、恢复责任,以及同时运行两条路径所需的容量。在开放流量前解决缺失的运营所有权问题。
Organize and implement slices
组织实施切片
Review existing work before adding tickets. Map bounded results, acceptance checks, and evidence gaps. Separate shared context from actual prerequisites, and build prerequisites from exposure prerequisites. State each prerequisite's reason and satisfaction condition; check direction, cycles, duplicate work, and obsolete dependencies.
Separate implementation from operational transition when their requirements differ. Keep later design awaiting pilot evidence explicit while accounting for recovery and eventual legacy removal. Assess specification gaps, autonomous readiness, and human decisions using repository rules. Maintain the plan, labels, decisions, and follow-up comments through its documented workflow, within authorized publication scope. Comments explain consequential changes, evidence, and next actions without duplicating the plan.
Implement authorized slices using the available implement skill, or the repository's implementation workflow if it is unavailable. Use its TDD, checks, and review discipline. Add migration-specific behavior at agreed public test seams: coexistence, compatibility, activation, and recovery. Existing agreements need not be requested again.
Where relevant legacy behavior lacks protection, add characterization tests at observable seams before replacing it. Preserve required behavior and distinguish accepted changes from defects discovered during characterization.
Turn agreed architectural goals into focused fitness functions where automation is useful: independent deployment checks, dependency restrictions, contract compatibility, or cross-component latency budgets. Explain what each check proves; choose checks from the intended benefit and enforce them at the appropriate build, deployment, or operational stage.
Build the alternative with activation under agreed control and observability for behavior comparison and failure detection. When using shadow testing, read shadow testing and equivalence before implementing or operating the comparison, in either direction.
A slice is ready for canary exposure when its alternative behavior and continuity checks pass, required compatibility and recovery are verified, operational controls are usable, implementation checks and review are complete, and operational prerequisites are satisfied. Local checks establish implementation evidence, not production completion.
在新增工单前,先审查现有工作。梳理边界明确的结果、验收检查和证据缺口。将共享上下文与实际前置条件区分开来,并从开放前置条件中构建使能前置条件。说明每项前置条件的原因和满足条件;检查依赖方向、循环、重复工作和过时依赖。
如果实施与运营切换的要求不同,应将二者分开。后续设计中依赖试点证据的部分应保持明确,同时兼顾恢复和最终移除旧系统。按照代码仓库规则评估规格缺口、可自主推进的就绪度和人工决策。在已授权的发布范围内,按照既定工作流维护计划、标签、决策和后续评论。评论应说明重大变更、证据和下一步行动,不重复计划内容。
使用可用的 implement skill,或在不可用时使用代码仓库的实施工作流,实施已授权切片。遵循其中的 TDD、检查和评审纪律。在约定好的公共测试接缝处添加迁移特有行为:共存、兼容性、启用和恢复。对于已有约定,无需再次请求确认。
如果相关旧行为缺乏保护,应在替换之前于可观测接缝处添加 characterization test。保留必需行为,并区分已接受的变更与特征化过程中发现的缺陷。
将商定的架构目标转化为聚焦的 fitness functions,并在自动化能够发挥作用时加以应用:独立部署检查、依赖限制、契约兼容性或跨组件延迟预算。说明每项检查能够证明什么;从预期收益出发选择检查,并在适当的构建、部署或运营阶段强制执行。
在约定控制和可观测性下构建替代方案,以便比较行为并检测故障。使用 shadow testing 时,无论比较方向如何,在实施或运行比较之前都应阅读 shadow testing 与等价性。
当替代方案行为和连续性检查通过、所需兼容性与恢复机制已验证、运营控制可用、实施检查和评审已完成且运营前置条件均得到满足时,该切片即可准备接受 canary 流量。局部检查只能证明实施情况,不能证明生产迁移已经完成。
Canary, transfer, and promote
Canary、流量转移与晋级
Define promotion and recovery criteria before exposure. For each affected flow, specify the initial audience or operation set, journeys, baseline, validation scenarios, indicators, thresholds, observation period, and sufficient sample coverage. Prefer automated user journeys, with manual validation as a complement. Include representative reads, writes, full journeys, and relevant user and data conditions; a traffic percentage alone is insufficient coverage.
Within authorized operational scope, expose the canary and compare errors, latency, user outcomes, and data correctness against the baseline for every required flow. Evaluate the canary separately from the legacy path so aggregate success cannot hide failures. Resolve misleading probes, inconclusive comparisons, and measurement gaps before using them as promotion evidence.
Before each promotion or transfer of authority, revalidate the agreed recovery against current data, active versions, and in-flight work, including valid activity produced on the new path. Maintain this evidence until final migration acceptance. Expand traffic or perform the planned switch only when the slice's gate passes. Verify each transition and maintain consequential evidence. On a failed gate, stop expansion, execute the agreed recovery within authorized scope, and diagnose before retrying. Choose observation periods from the evidence required rather than arbitrary calendar waits.
If access or authorization is missing, complete independently possible work, prepare the concrete operational next step, and identify the unmet requirement and unexecuted actions. Distinguish completed implementation from actual exposure.
在开放流量前定义晋级和恢复标准。对于每条受影响流程,指定初始受众或操作集合、旅程、基线、验证场景、指标、阈值、观察时段和充足的样本覆盖。优先采用自动化用户旅程,并辅以人工验证。纳入代表性读取、写入、完整旅程,以及相关用户和数据条件;仅以流量百分比衡量不足以构成充分覆盖。
在已授权的运营范围内开放 canary 流量,并将每条必需流程的错误率、延迟、用户结果和数据正确性与基线比较。分别评估 canary 和旧路径,避免总体成功率掩盖局部失败。在将结果用作晋级证据之前,解决误导性探针、无法得出结论的比较和测量缺口。
在每次晋级或权威转移之前,针对当前数据、活跃版本和进行中的工作重新验证商定的恢复方案,其中包括新路径上产生的有效用户活动。保留这些证据,直至最终迁移验收。只有在切片关卡通过后,才能扩大流量或执行计划中的切换。验证每次过渡,并保留重大决策所需的证据。关卡失败时,停止扩大流量,在授权范围内执行商定的恢复方案,并在重试前完成诊断。观察时段应根据所需证据确定,而不是任意按日历等待。
如果缺少访问权限或授权,应完成所有可独立开展的工作,准备具体的运营下一步,并指出尚未满足的要求和未执行的操作。应明确区分已完成的实施与实际开放。
Retire and verify completion
退役并验证完成
When unknown consumers may remain despite the inventory, consider a scream test. Read scream tests before proposing or operating either reversible disablement or consumer-controlled deprecation opt-in. Apply the procedure only within its explicitly accepted scope.
Retire the old path after the new path meets migration criteria and evidence shows required consumers, live versions, background jobs, and in-flight work no longer depend on it. Compare the intended benefits against their baseline, including architectural checks and operational results. Account for compatibility and recovery needs; elapsed time alone does not establish readiness.
Remove temporary flags, routing branches, adapters, synchronization, and infrastructure when no longer required, preserving shared resources and unrelated behavior. Verify affected journeys and operational evidence, including cessation of obsolete execution or consumption where applicable.
Refresh and verify records after authorized publication, preserving unrelated concurrent edits. Establish current state before retrying ambiguous writes to avoid duplicates.
Report behavior, validation evidence, actual exposure, recovery readiness, remaining dependencies, and outstanding actions. Distinguish a completed plan, implementation, partial rollout, and completed migration. The migration is complete only when the intended scope uses the new path, required continuity evidence is verified, and agreed retirement work is done.
如果盘点后仍可能存在未知使用方,可考虑进行 scream test。在提出或执行可逆停用、使用方可控的弃用选择加入之前,请阅读 scream test。仅在明确接受的范围内应用该流程。
在新路径满足迁移标准,且证据表明必需使用方、线上版本、后台作业和进行中的工作均不再依赖旧路径后,方可退役旧路径。将预期收益与基线比较,其中包括架构检查和运营结果。兼顾兼容性与恢复需求;仅凭时间流逝不能证明已经就绪。
当临时 flag、路由分支、适配器、同步机制和基础设施不再需要时,将其移除,同时保留共享资源和无关行为。验证受影响的旅程和运营证据,包括在适用时确认旧执行或旧消费已经停止。
在获得授权发布后,更新并核验记录,同时保留无关的并发编辑。在重试结果不明确的写入之前,先确定当前状态,以避免重复。
报告行为、验证证据、实际开放情况、恢复就绪度、剩余依赖和未完成事项。明确区分已完成的计划、已实施、部分放量和已完成迁移。只有当预定范围已使用新路径、所需连续性证据已验证,并且商定的退役工作已完成时,迁移才算完成。