File tree Expand file tree Collapse file tree 3 files changed +65
-2
lines changed Expand file tree Collapse file tree 3 files changed +65
-2
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,8 @@ toc_landing_pages = ["/quickstart",
2323 " /faq" ,
2424 " /reference/collection-level-filtering" ,
2525 " /reference/verification" ,
26- " /reference/mongosync"
26+ " /reference/mongosync" ,
27+ " /reference/cutover-process"
2728 ]
2829
2930[constants ]
Original file line number Diff line number Diff line change 1+ .. _c2c-migrate-pqs:
2+
3+ =================================
4+ Migrate Persistent Query Settings
5+ =================================
6+
7+ .. default-domain:: mongodb
8+
9+ .. contents:: On this page
10+ :local:
11+ :backlinks: none
12+ :depth: 2
13+ :class: singlecol
14+
15+ If your source cluster uses Persistent Query Settings (PQS), you must manually
16+ migrate those settings to your destination cluster to finalize sync.
17+
18+ ``mongosync`` checks for PQS during initialization and the :ref:`cutover process
19+ <c2c-cutover-process>`. If ``mongosync`` finds PQS on the source cluster during
20+ cutover, {+c2c-product-name+} shows a warning. Use the following procedure to
21+ address the warning and migrate your PQS to your destination cluster.
22+
23+ Steps
24+ -----
25+
26+ .. procedure::
27+ :style: normal
28+
29+ .. step:: Export your Persistent Query Settings.
30+
31+ Run the following code block to output your query settings into an array:
32+
33+ .. code-block:: shell
34+
35+ mongosh --eval
36+ 'console.log(db.aggregate([{$querySettings:{}}]).toArray())'
37+
38+ .. step:: Import your PQS to the destination cluster.
39+
40+ For each query setting that you want to migrate, use
41+ :dbcommand:`setQuerySettings` to apply that setting to your destination
42+ cluster.
43+
44+ If the query setting includes a ``representativeQuery`` field value, use
45+ that field value as the ``setQuerySettings`` value.
46+
47+ Otherwise, use the ``queryShapeHash`` field value from the
48+ ``querySettings`` array as the ``setQuerySettings`` value.
49+
Original file line number Diff line number Diff line change @@ -120,7 +120,15 @@ Steps
120120 to ensure that the ``mongosync`` state is ``COMMITTING`` or
121121 ``COMMITTED``.
122122
123- Once you complete this step, ``mongosync`` blocks writes on the source cluster.
123+ Once you complete this step, ``mongosync`` blocks writes on the source
124+ cluster.
125+
126+ If your source cluster contains Persistant Query Settings (PQS), you must
127+ :ref:`manually migrate PQS <c2c-migrate-pqs>` to your destination cluster.
128+
129+ If you previously set ``enableUserWriteBlocking``
130+ to ``true``, ``mongosync`` blocks writes on the source cluster
131+ once you complete this step.
124132
125133 .. step:: Wait until you can perform writes on the destination cluster.
126134
@@ -221,3 +229,8 @@ Learn More
221229- :ref:`c2c-api-progress`
222230- :ref:`c2c-states`
223231
232+ .. toctree::
233+ :titlesonly:
234+
235+ Migrate Persistent Query Settings </reference/c2c-migrate-pqs>
236+
You can’t perform that action at this time.
0 commit comments