सामग्री पर जाएँ
दस्तावेज़

DB Copy

4 phases में clusters के बीच पूरे databases या selected collections copy करें: schema (ADD/DROP), indexes, data, per-document resolution। Typed-confirmation, transients का retry, Retry-failed बटन, और immutable audit envelopes के साथ।

यह क्या है

एक workspace + engine जो source MongoDB cluster से target तक multi-phase copy चलाता है। Phase 1 namespace list को reconcile करता है (missing collections का ADD, typed confirmation के साथ extras का DROP)। Phase 2 indexes को reconcile करता है (per-index spec match)। Phase 3 documents copy करता है (retry के साथ parallel batches)। Phase 3b samplePairs के माध्यम से per-document differences को reconcile करता है। हर phase plan + result hash के साथ एक audit envelope emit करता है।

कब उपयोग करें

Dev / staging refresh, cluster migration (जैसे on-prem से Atlas), region migration, या cluster upgrade के दौरान चलाएँ। Typed-confirmation accidental drops को रोकता है; audit envelope हर change का evidence प्रदान करता है।

इसे कैसे खोलें

  1. NoSqlStudio desktop ऐप में, Tools menu → Migrate and Diff → Copy DB खोलें, या Ctrl+Alt+P दबाएँ।
  2. एक wizard source / target picker, namespace selection, और per-phase toggles के साथ खुलता है।
  3. Source + target connections चुनें, फिर चुनें कि कौन से databases / collections copy करने हैं।

4 phases

  1. Phase 1 (ADD/DROP) — namespace list reconcile करता है। Wizard दिखाता है कि कौन सी collections बनेंगी और target पर कौन सी drop होंगी। Drops को typed-confirmation की आवश्यकता होती है (बटन enable करने के लिए collection name paste करें)।
  2. Phase 2 (indexes) — हर index को full spec match के साथ reconcile करता है। समान नाम लेकिन अलग spec वाले indexes drop और recreate किए जाते हैं।
  3. Phase 3 (data) — parallel batches में documents copy करता है। Transient failures (network blip, connection reset) auto-retry; engine progress stream करता है जिसमें rows / second और ETA शामिल है।
  4. Phase 3b (per-document resolution) — collections के लिए जहाँ per-row diff matter करता है, engine N matching keys sample करता है और side-by-side viewer में per-document diffs दिखाता है। आप हर एक को accept, override, या skip कर सकते हैं।
  5. Retry-failed — जब एक phase failures के साथ खत्म होती है, engine एक Retry-failed बटन surface करता है जो केवल failed items को re-run करता है। Audit Log दोनों runs दिखाता है।

Audit

हर phase `copy.finish` / `sync.finish` / `resolve.finish` audit envelope emit करती है जिसमें plan snapshot, result snapshot, और एक hash शामिल है ताकि एक external auditor साबित कर सके कि run silently re-played नहीं हुई।

Continuous sync (CDC)

DB Copy CDC sub-flow change streams के माध्यम से target को sync में रखता है। Initial bulk copy के बाद, engine oplog / change stream events को subscribe करता है और उन्हें bounded lag के साथ target पर apply करता है। Schema Diff workspace per-collection migration script emit करने के लिए उसी pipeline में plug करता है।

सीमाएँ (v1)

  • Phase 3b sample-based resolution best-effort है। बड़ी collections पर ironclad per-row consistency के लिए, एक server-side check के साथ follow up करें।
  • CDC को दोनों clusters का change streams expose करना चाहिए — replica sets और sharded clusters पर काम करता है; standalone mongod समर्थित नहीं है।
  • Phase 1 drops irreversible हैं। Typed-confirmation आपका एकमात्र safety net है — paste करने से पहले dialog ध्यान से पढ़ें।