Вихідні перемикання
Також доступно 19 мовами
English · Español · 日本語 · Português (Brasil) · Français · Deutsch · Italiano · 한국어 · 简体中文 · Português (Portugal) · 繁體中文 · Bahasa Indonesia · Türkçe · Polski · Tiếng Việt · ไทย · Español (México) · Français (Canada) · Deutsch (Schweiz)

Модуль 4 з 5 розділу Міграція і синхронізація, розділ 10 курсу Data Architect. Кожен модуль самостійний. Previous: Automation During the Load · Next: Getting Data Out: Keeping Another System in Step ⟲
Питання, на яке відповідає цей модуль: Як перемкнутися і довести, що міграція спрацювала?
П’ятниця, вечір. Користувачі пішли, міграційна команда онлайн, і хтось каже: «Ми тестували це тричі. Поїхали». Добре. Що саме ми збираємося робити? Коли стара система перестає змінюватися? Коли останнє вивантаження? Хто вимикає автоматизацію, хто запускає кожне завантаження? Що, як опівночі ми відстаємо на дві години або 3 відсотки акаунтів не пройшли? Хто вирішує, чи продовжувати? Як ми доведемо, що дані правильні, і коли користувачі зможуть повернутися? А якщо все піде погано: як ми вийдемо? Перемикання — це не «запустити міграцію». Це контрольований перехід з одного відомого стану в інший.
Start With the Picture
Section titled “Start With the Picture”Here’s our landscape one more time. This is the weekend that amber arrow runs, and then disappears. ⟲
The weekend this arrow runs. On Monday morning, it’s gone. ⟲
But more changes that weekend than one arrow. The partners’ manifests stop landing in RouteDesk and start arriving through the integration layer. RouteDesk’s own outbound feeds, Keystone’s nightly status file and Redrock’s webhook, have to come from Salesforce instead. Coordinators route Monday’s deliveries in Field Service, not RouteDesk. And on Monday morning, 330 trucks leave the distribution centers on routes from the new system. Everything in this module is about getting to that Monday safely, and knowing what we’d do if we couldn’t. ⟲
Production має бути нудним
Section titled “Production має бути нудним ”Я хочу, щоб перемикання в production здавалося майже розчаруванням. Ми вже прогнали процес, заміряли час, побачили збої, протестували обходи, звірили результати і потренувалися відновлювати звичайну роботу. Production — це той самий сценарій із новими даними. Якщо ми вигадуємо міграцію на вихідних перемикання, у нас уже проблеми.
That takes a dress rehearsal, not “we loaded accounts in the sandbox.” Beginning to end: a final-style extract, transformations, quality checks, the load sequence, automation and integration controls, reconciliation, deferred processing, the return to normal mode, all timed, at production or representative scale, in a Full sandbox. Record how long each step took, what failed, what needed manual help, what confused people, where we waited, what surprised us. Then improve the runbook. The first rehearsal teaches you how the migration works; the next one should prove you learned. And because module 2 brought the keys back, a rehearsal doesn’t have to start from nothing every time: fix one transformation, reload just the rows it touched, and run the reconciliation again. For RouteDesk, that means the whole weekend in a Full sandbox: the extract, the preparation data store, the waves of module 1, the bypass of module 3, the switch of the partners’ feeds, and the reconciliation, with a stopwatch running. ⟲
Runbook — це виконувана архітектура
Section titled “Runbook — це виконувана архітектура ”Не «суботній ранок: мігрувати дані». Щось ближче до такого:
| Крок | Дія | Відповідальний | Очікувана тривалість | Доказ / критерій завершення |
|---|---|---|---|---|
| 1 | Confirm RouteDesk is read-only after Saturday’s last truck | Operations lead | 10 min | Written confirmation; time of the last change recorded |
| 2 | Final RouteDesk extract into the preparation data store | Data team | 45 min | Counts and control totals captured |
| 3 | Confirm the bypass on the migration user | Salesforce team | 10 min | A test record saves with no status events sent |
| 4 | Incremental load: Saturday’s changes, upsert by the partner key | Migration team | 30 min | Results and new IDs back in the preparation data store |
| 5 | Reconcile against the expected numbers | Data team and operations | 30 min | Counts, totals and aggregate reports approved |
| 6 | Switch the partners’ manifests and status feeds to the integration layer | Integration team | 30 min | One test manifest upserted and one status sent, per partner |
| … | … | … | … | … |
| 14 | Remove the bypass from the migration user | Salesforce team | 10 min | Permission set unassigned, and checked |
Now we know what happens, who does it, how long we expect, and what proves each step is complete. That’s much stronger than a checklist that says “Load Work Orders.” Notice step 14. Module 3’s bypass is a permission to skip business rules, so taking it away is a runbook step with an owner, not something we hope someone remembers. ⟲
Д−7, Д−1, день Д
Section titled “Д−7, Д−1, день Д ”I call go-live Day 0: usually a Sunday or another off-hours day. Steve Trucking delivers six days a week, so Day 0 is the Sunday with no trucks on the road. Day +1 is after it; Day −1 and Day −7 are before it. And on any large load, I ask: do I have to wait until Day 0 to load all the data? If the load takes hours and the source keeps changing, I’m going to need an incremental anyway. So: ⟲
- Day −7: the initial load. Load the bulk of the data a week early, kept invisible by sharing, so users and reports don’t see it. Smoke-test users (a system administrator) validate it in place. Ask the business what would be hurt by loading early; if the answer is “it would break my reports,” load it hidden. It’s much simpler to open up the sharing on Day 0 than to spend five hours loading a million records and all their children inside the window. ⟲
- Д−1: оновлювальне завантаження. Перенесіть те, що змінилося від Д−7, і захистіть стартову лінію: чи досі користувачі змінюють джерело, чи пишуть інтеграції, чи працюють заплановані завдання? Заморозьте джерело, зробіть його лише для читання або точно визначте, як будуть зафіксовані зміни після вивантаження.
- День Д: інкремент. Завантажте те, що змінилося від Д−1 (іноді один інкремент на початку вікна і фінальний наприкінці), звірте, ухваліть go чи no-go, відкрийте спільний доступ, відновіть звичайну роботу.
For RouteDesk, Day −7 is the Sunday before: the 190,000 delivered Work Orders go in, hidden by sharing, and smoke-test users check them all week. History barely changes, so most of the load is done before the weekend starts. Day −1 is Saturday night, once the last truck is back: RouteDesk goes read-only, and the refresh brings the week’s changes. Day 0 is Sunday: a small incremental, then the gates. ⟲
Day −7: most of the data, a week early, where nobody can see it yet. ⟲
Day −1: the week’s changes, and the source stops moving. ⟲
Day 0: a small incremental, then the gates. ⟲
Day +1: the first truck leaves, and the rollback clock runs out. ⟲
This isn’t an unusual way to cut over; it’s the common one, under other names. Salesforce’s own guidance for moving a B2C Commerce site says to migrate as much data as you can “as close as possible prior to the actual cut-over. Ideally, only the delta from the previous day should be required to copy during the cut-over to minimize the down time” (B2C Commerce Realm Split FAQ (відкривається в новій вкладці), Salesforce Help). Microsoft’s guidance for its own platform is a full migration “about a month before go-live, followed by weekly delta loads,” with the final delta “after freezing both source and target systems” (Data migration planning for go-live (відкривається в новій вкладці), Microsoft Learn). And AWS’s database migration service builds the same idea in: a full load while it captures changes, then “shut down your applications, let the remaining changes flow through to the target” (Components of AWS DMS (відкривається в новій вкладці), AWS; all three checked 2026-10-27). The timing changes with the volume: a month or a week ahead, weekly or daily deltas. The Salesforce twist is the one I add: load early hidden by sharing, so the data is in place and checked, and nobody sees it until Day 0. ⟲
Test knowledge. For a large migration with a short cutover window, load most of the data days early, hidden from users by sharing, then load only what changed (a refresh before the window, an incremental inside it). Freeze or capture changes in the source from the extract onward, and validate with test users before opening access. ⟲
For the cutover, the point is the gates around those loads. By Day −7 I don’t want to be designing the migration anymore: mappings, transformations, the load sequence, automation decisions, migration identities, reconciliation reports, the runbook, rollback criteria and known exceptions are stable, because the real loads have started. Things can still change, but every late change reduces rehearsal. At some point you stop improving the migration and start protecting the cutover. And know when the source stopped moving, or know exactly how you’ll capture what changed after your extract. ⟲
That second half is the watermark: the point through which each extract was current, so the next load knows what changed since. For RouteDesk, the watermark is the moment of each extract: everything RouteDesk changed after Sunday’s Day −7 extract is in Saturday’s refresh. That only works if RouteDesk records when a delivery last changed, so check that it does, and that every DC’s screens update it. If it doesn’t, compare snapshots: extract again and find the differences by key. Slower, but it’s a watermark you can trust. Without one, delta processing is guesswork. ⟲
Тоді день Д — це виконання. Ідіть за runbook, записуйте фактичний час, ID завдань, кількості, помилки й рішення. Якщо крок 17 не вдався, не перескакуйте до кроку 24, бо комусь здається, що це заощадить час: зрозумійте залежність, застосуйте процедуру відновлення, оновіть стан. Команда завжди має бути здатна сказати, де ми, що завершено, що не вдалося, що далі і чи ми досі у вікні.
Блокуйте користувачів, коли вам потрібен контроль
Section titled “Блокуйте користувачів, коли вам потрібен контроль ”Ніхто не любить простоїв. Але вдавати, що система доступна, поки ми міняємо їй фундамент, може бути гірше, і «ми хочемо нульового простою» не повинно тихо перетворюватися на «ми гадки не маємо, яка версія даних авторитетна». Іноді найчистіша стратегія — заблокувати користувачів, виконати перемикання, довести результат і впустити їх назад. Як?
- Жорсткі способи: заморозити користувачів, змінити їхні години входу або обмежити діапазони IP. Не деактивуйте їх: це ламає власність і все, що до неї прив’язано.
- М’який спосіб: login flow, який дає людям увійти й відправляє їх у кімнату очікування: «у системі тривають роботи; поверніться пізніше». Привітніше, ніж помилки, через які користувачі думають, що їхній акаунт зламано. Ніколи не ставте цей login flow на системних адміністраторів; якщо він зламається, ніхто не зайде.
- Завжди залишайте чорний хід: групу системних адміністраторів (і ваших користувачів для smoke-тестів), які все одно можуть увійти.
- Сесії залишаються. Блокування користувачів не завершує вже відкритих сесій, тож сплануйте, як вивести людей, які ще працюють: оголошення, дедлайн або, з користувацькою розробкою, спосіб їх розлогінити.
At Steve Trucking it’s Sunday, so the people to plan for are the care agents answering phones, the coordinators getting ready for Monday, and the 300 Retail Partner users who might log in to the portal to check a claim. Login flows are assigned by profile (Custom Login Flows (відкривається в новій вкладці), Salesforce Help, checked 2026-10-27), so the partners’ profile can get the waiting room (“your deliveries are moving to a new system; back Monday at 6 a.m.”) while the smoke-test users and administrators come and go. ⟲
Не вигадуйте цього за тиждень до події. Вирішіть, що побачать користувачі, і скажіть їм.
Test knowledge. To keep users out during a cutover, freeze their accounts, restrict login hours or IP ranges, or use a login flow (assigned by profile) as a waiting room. Don’t deactivate users: it breaks ownership and what’s attached to it. Keep administrators and test users able to log in. ⟲
Go/no-go і годинник відкату
Section titled “Go/no-go і годинник відкату ”Друга ночі, дванадцять годин роботи позаду — не час вигадувати критерії go/no-go. Визначте їх до перемикання: критичні об’єкти звірено, частка збоїв нижча за схвалений поріг, немає невирішених критичних дефектів даних, обов’язкові зв’язки перевірено, критичні інтеграції перевірено, автоматизацію відновлено й протестовано, продуктивність прийнятна, бізнес-перевірку завершено, часу на подальші кроки досить. Інакше «go» стає «ми вже стільки пройшли». Це не архітектура. Це упередження невідворотних витрат.
“We have a rollback plan.” Good. Until when? We migrate, open Salesforce, and for six hours users create cases, update accounts, enter opportunities, change contact details, while integrations send data elsewhere. Can we restore Friday night? Not without losing legitimate work. Rollback gets harder the longer the new system runs, so define the rollback point: before it, we return to the previous state with the tested procedure; after it, recovery needs a different strategy. Rollback has a clock, and the runbook should show it. For Steve Trucking the clock is easy to read: until Monday’s first truck leaves on a Field Service route, we can still send the coordinators back to RouteDesk, which is why it stays read-only and untouched until then. After that, every delivery made, photo taken and status sent lives only in Salesforce, and going back would lose real work. From that moment, recovery means fixing forward. ⟲
Відкат — це також не просто видалення завантаженого. Автоматизація могла створити дочірні записи, інтеграції могли надіслати записи деінде, користувачі могли змінити мігровані записи, могли з’явитися вкладені файли, опубліковані події, оновлені наявні записи. Розподілені наслідки — ось чому контролі автоматизації й інтеграцій із модуля 3 є архітектурою перемикання.
And what makes you roll back? In my experience it’s rarely the loader. It’s unknown data: you find out something key was missed, or a data feed was running that nobody accounted for. The best rollback plan is not needing it: know all of your key data, and every feed that touches it, before cutover. RouteDesk has two that are easy to forget, because they go out, not in: the nightly status file Keystone picks up, and the webhook that tells Redrock what happened. Retire RouteDesk without moving them, and on Monday night Keystone hears nothing. Nobody loaded the wrong data; a feed just stopped. ⟲
Чотири способи, якими я доводжу дані
Section titled “Чотири способи, якими я доводжу дані ”Після завантаження я не питаю «чи сказав API, що все вдалося?». Я хочу чотири види доказів і використовую всі чотири: кількості, підсумки, вибіркові перевірки й зведені звіти.
Кількості. Скільки записів має існувати і скільки існує? Вибрано акаунтів у джерелі: 500 000. Об’єднано дублікатів: 20 000. Виключено за схваленою політикою: 5 000. Очікувано: 475 000. У цілі: 475 000. Добре, але самі кількості — не доказ; можна мати правильну кількість записів і хибні дані.
Підсумки. Де важать числа, порівнюйте контрольні підсумки: суму рахунків, вартість замовлень, відкритий залишок, кількість товару. В обох системах по 100 000 рахунків, але у старій сума 412 800 000 доларів, а в Salesforce 398 100 000 доларів. Стоп. Підсумки показують те, що пропускають кількості.
Spot checks. Look at real records, not just easy ones: a simple record and a complex one, a large customer and a small one, one with many children, one that was transformed, one involved in dedupe, one with unusual history. Trace each from source to target: fields, relationships, ownership, history, External IDs. Averages hide serious individual failures. ⟲
Зведені звіти. Порівнюйте форму: акаунти за штатами, замовлення за роками, звернення за статусом, клієнти за сегментом, виручка за місяцями. Якщо джерело каже 82 000 клієнтів в Аризоні, а Salesforce — 8 200, у нас є зачіпка: код штату, що не змапився, виключений рік, неправильно перекладений статус, пропущений файл. Кількість рядків може виглядати нормально, а розподіл розповідає історію.
For RouteDesk, each proof has its check, and each catches something the others miss. ⟲
Each proof catches what the others miss. Use all four. ⟲
The aggregate report is the one I’d watch first. Remember module 1’s status codes: nine DCs, nine spellings. If DC 7’s deliveries by week come out 40 percent short against RouteDesk’s, the count for the whole load might still look close, but one DC’s DONE/INST didn’t map. ⟲
Test knowledge. Prove a migration with more than “no errors”: record counts against expected numbers set before the load, control totals on amounts that matter, spot checks of real records traced end to end, and aggregate reports that compare the shape of the data. Business owners validate it too. ⟲
До них додаються два правила. Перше: встановіть очікувані числа до завантаження (модуль 1): кількість у джерелі, схвалені виключення, об’єднані дублікати, записи в карантині, очікувана ціль. Потім порівняйте й поясніть різницю. Очікуване число, вигадане після того, як побачили результат, — не звірка; це раціоналізація. Друге: нуль помилок теж може бути хибним. Змапте Billing State у Shipping State, і кожен рядок завантажиться без жодної помилки API: бездоганне технічне виконання, хибна архітектура. Ось чому важлива бізнесова звірка, а не лише технічні журнали.
Власники бізнесу теж перевіряють
Section titled “Власники бізнесу теж перевіряють ”Технічна команда може довести кількості, ключі, зв’язки й успішність завантаження. Бізнес-користувачі впізнають те, чого не впізнаємо ми: «це не наші активні клієнти», «цей статус не використовують із 2022 року», «ці акаунти не з того регіону», «у цього клієнта мають бути три чинні контракти». Тож бізнесова перевірка — явний крок запуску з названими людьми, названими звітами, названими записами і названим схваленням, а не «гляньте, коли буде час».
Authority Moves on Day 0
Section titled “Authority Moves on Day 0”Why not move everything on Day 0? The Number of Zeros. If the full migration takes 18 hours and the business tolerates 4 hours of downtime, we have a problem, and moving data earlier solves it. History goes in before cutover while the legacy system stays authoritative; the window only has to handle what changed, what couldn’t be preloaded, final relationships, validation and reconciliation. Instead of moving eight years of history during the outage, we’re closing a gap. ⟲
But preloaded data needs protection. If production data lands on Day −7, can users see it, edit it, can automation react, can integrations publish it, can agents act on it? The answer should be: not yet. So we keep it hidden by sharing, owned and controlled, with automation and integrations held back (module 3). A preload isn’t “put the records in early.” It’s put them in early without accidentally making the new system authoritative early. ⟲
Before cutover, the legacy system is authoritative and Salesforce holds a staged, increasingly current copy. During cutover we close the gap. At the agreed moment, authority moves, and afterward Salesforce is authoritative. For Steve Trucking that moment is Day 0: from then on, a delivery’s truth lives in Salesforce, and RouteDesk is a read-only record of the past. That’s where chapters 6, 9 and 10 meet: identity, authority, movement and cutover aren’t separate problems; they’re views of the same data lifecycle. ⟲
So don’t let two systems both think they’re master. If the legacy system stays writable after cutover, a coordinator changes a delivery window in Salesforce, another changes it in the legacy system, and both systems think they own it. Last write wins? Salesforce wins? Human review? If that’s unanswered, we haven’t finished a migration; we’ve created two writable copies. Chapter 9’s rule: technical permission isn’t architectural authority. ⟲
Not every migration needs ongoing synchronization. If we’re replacing the legacy system completely, Day 0 comes, the final deltas load, reconciliation passes, users move, the old system goes read-only and is eventually archived or retired. Don’t build a permanent integration because “migrations usually have integrations.” If the old system is dead, stop feeding it. That’s RouteDesk: on Monday it’s read-only, then it’s retired, and nothing syncs with it. The synchronization Steve Trucking does need is a different arrow, Salesforce to Snowflake, designed in chapter 9 and covered in module 5. ⟲
The gap closes, authority moves, and the migration ends. The Snowflake feed goes on. ⟲
The opposite happens too. A transition that lasts months, users active in both systems, business units moving at different times: synchronization may have to start before the migration is finished. Now the migration is still moving the historical baseline while synchronization keeps live records consistent, and that’s a much harder architecture. You need to know which process owns which changes, or the load and the sync overwrite each other. So define the boundary visibly: before this point we’re building the target state; after it we’re maintaining consistency. It might be a timestamp, a cutover event, a business-unit transition, an object-by-object switch, a watermark. If nobody can tell me whether a record belongs to the migration process or the synchronization process, we have overlapping ownership, and that’s where records get missed or processed twice. ⟲
Назад до звичайного, а потім hypercare
Section titled “Назад до звичайного, а потім hypercare ”Restore normal operation deliberately: automation, scheduled jobs, integrations, event consumers, agents, user access, in an order that matters. For Steve Trucking: take the bypass away from the migration user, switch the Change Data Capture subscriber back on from the cutover point (so Snowflake gets Monday’s changes, not the weekend’s load), run module 3’s one backfill, then let the coordinators in. Remember module 3’s catch-up storm: when an integration comes back, what does it think happened while it was off? When users come back, is every critical service actually ready? The return to normal is part of the cutover. ⟲
Потім ми в роботі, але ще не закінчили. Упродовж періоду стабілізації (назвімо його hypercare, періодом посиленої підтримки) стежте за помилками міграції, збоями інтеграцій, неочікуваною автоматизацією, новими дублікатами, відсутніми зв’язками, проблемами продуктивності, проблемами з даними, про які повідомляють користувачі, і дрейфом звірки. Ризик міграції не зникає тієї миті, коли користувачі входять у систему.
Then clean up: temporary migration users and permissions, bypass settings, staging data, temporary scripts, migration-only configuration, files holding sensitive source data, temporary integrations, runbook access. Don’t leave migration scaffolding attached to production because “we might need it someday.” Temporary architecture needs an exit plan too. Don’t forget the preparation data store. After RouteDesk, it holds eight years of Recipients’ names, addresses and phone numbers in its raw tables. Keep what the retention policy says to keep, as evidence, then delete the rest, on a date someone owns. ⟲
І зберігайте докази: фінальне вивантаження, версію перетворень, файли завантаження, результати завдань, файли помилок, звіти звірки, схвалення, runbook із фактичним часом, рішення go/no-go і винятки. Через три тижні хтось спитає, чи був запис хибним до міграції чи через неї. Ви маєте змогти відповісти. Довіряй, але перевіряй не закінчується, коли завершилося завантаження.
ШІ може допомагати стежити за перемиканням. Go/no-go — не його рішення.
Section titled “ШІ може допомагати стежити за перемиканням. Go/no-go — не його рішення. ”ШІ корисний під тиском перемикання: підсумовує збої, класифікує помилки, порівнює звіти, помічає аномалії, відстежує runbook, показує відхилення від репетиції. Але go/no-go поєднує технічні докази, бізнесовий вплив, залишок часу, позицію щодо відкату і готовність до ризику. ШІ може винести докази на поверхню. Рішення ухвалюють відповідальні люди.
За межами іспиту: що змінює ШІ. ШІ може пришвидшити моніторинг перемикання і звірку, особливо знаходячи закономірності у великих наборах даних про помилки й перевірки. Залишайте за людьми явну відповідальність за go/no-go, відкат і прийняття невирішеного міграційного ризику.
Що тут вирішує архітектор
Section titled “Що тут вирішує архітектор ”- The rehearsal depth, the Day −7 / Day −1 / Day 0 load plan and the rollback point (what loads early, hidden by sharing) and the runbook that makes production cutover repeatable. ⟲
- Як користувачів блокують і впускають назад, із чорним ходом і користувачами для smoke-тестів, і як тим часом контролюють автоматизацію, інтеграції й агентів.
- Критерії go/no-go, процедура відкату і точка, після якої відкат перестає бути безпечним відновленням, а також невідомі дані й потоки, які треба знайти першими.
- Як міграцію доводять кількостями, підсумками, вибірковими перевірками й зведеними звітами порівняно з очікуваними значеннями, встановленими до завантаження.
- Які бізнесова перевірка, докази і стабілізація після запуску потрібні, перш ніж міграцію буде завершено.
Перемикання — це доказ
Section titled “Перемикання — це доказ ”Скрипти відпрацювали: замало. API повернув успіх: замало. Кількості рядків збіглися: усе ще замало. Я хочу кількості, підсумки, вибіркові перевірки й зведені звіти, бізнесову перевірку, систему, повернуту до звичайного стану, знання, чи ми досі у вікні відкату, і докази того, що саме сталося. Перемикання в production має бути нудним, бо найважче мислення ми зробили до вечора п’ятниці. Довіряй, але перевіряй. А тоді впустіть користувачів назад.
Додаткові матеріали
Section titled “Додаткові матеріали ”- Others who cut over the same way: Salesforce Help, B2C Commerce Realm Split FAQ (відкривається в новій вкладці); Microsoft Learn, Data migration planning for go-live (відкривається в новій вкладці); AWS, Components of AWS DMS (відкривається в новій вкладці); all checked 2026-11-01. ⟲
- Salesforce Help: Freeze or Unfreeze User Accounts (відкривається в новій вкладці) and Custom Login Flows (відкривається в новій вкладці) (login flows are assigned by profile), checked 2026-11-01. ⟲
- У цьому курсі: Основні дані та ідентичність і Інтеграція і переміщення даних.
