|
| 1 | +:orphan: |
| 2 | +:template: guide |
| 3 | + |
| 4 | +.. _guide-migrate-compose: |
| 5 | + |
| 6 | +===================================== |
| 7 | +Migrate from Compose to MongoDB Atlas |
| 8 | +===================================== |
| 9 | + |
| 10 | +.. default-domain:: mongodb |
| 11 | + |
| 12 | +.. contents:: On this page |
| 13 | + :local: |
| 14 | + :backlinks: none |
| 15 | + :depth: 1 |
| 16 | + :class: singlecol |
| 17 | + |
| 18 | +Overview |
| 19 | +-------- |
| 20 | + |
| 21 | +.. short-description:: |
| 22 | + |
| 23 | + Migrate data from Compose to MongoDB Atlas. |
| 24 | + |
| 25 | +This guide walks you through how to migrate data from Compose to MongoDB Atlas |
| 26 | +using the Atlas Live Migration process. |
| 27 | + |
| 28 | +.. include:: /includes/live_migration_description.rst |
| 29 | + |
| 30 | +.. time:: 20 |
| 31 | + |
| 32 | +What You'll Need |
| 33 | +---------------- |
| 34 | + |
| 35 | +.. include:: /includes/migration_pr_compose.rst |
| 36 | + |
| 37 | +Procedure |
| 38 | +--------- |
| 39 | + |
| 40 | +.. procedure:: |
| 41 | + :style: normal |
| 42 | + |
| 43 | + .. step:: Create an Atlas deployment. |
| 44 | + |
| 45 | + If you don't already have an Atlas deployment, :atlas:`create one |
| 46 | + </tutorial/create-new-cluster>` now. |
| 47 | + You'll need a :atlas:`cluster tier |
| 48 | + </tutorial/create-new-cluster/#select-the-cluster-tier>` |
| 49 | + of ``M10`` or larger to perform Live Migration. |
| 50 | + |
| 51 | + .. step:: Log in to your Compose account. |
| 52 | + |
| 53 | + Log in to your `Compose account <https://app.compose.io/session/new>`_ |
| 54 | + and navigate to the deployment you want to migrate to Atlas. |
| 55 | + |
| 56 | + .. note:: |
| 57 | + It will be helpful during the migration process to keep one |
| 58 | + browser window open on your Compose deployment console and one |
| 59 | + window open on your `Atlas console <https://cloud.mongodb.com>`_. |
| 60 | + |
| 61 | + .. step:: Create an oplog user. |
| 62 | + |
| 63 | + .. procedure:: |
| 64 | + :style: connected |
| 65 | + |
| 66 | + .. step:: Click the :guilabel:`Add-ons` link in the left-side navigation. |
| 67 | + If you don't have the :guilabel:`Oplog Access` add-on, add it with the |
| 68 | + :guilabel:`Add` button. |
| 69 | + |
| 70 | + .. step:: If you already have the :guilabel:`Oplog Access` add-on, click |
| 71 | + :guilabel:`Configure` to see the oplog user username and password. |
| 72 | + |
| 73 | + .. figure:: /images/compose-oplog-addon.png |
| 74 | + :figwidth: 700px |
| 75 | + :alt: Shows the oplog username and password fields within the |
| 76 | + Oplog Access add-on. |
| 77 | + |
| 78 | + To perform the migration process, the oplog user must have |
| 79 | + the following privileges: |
| 80 | + |
| 81 | + - The :manual:`readAnyDatabase </reference/built-in-roles/#mongodb-authrole-readAnyDatabase>` role. |
| 82 | + - The :manual:`clusterMonitor </reference/built-in-roles/#mongodb-authrole-clusterMonitor>` role. |
| 83 | + - The :manual:`backup </reference/built-in-roles/#mongodb-authrole-backup>` role. |
| 84 | + |
| 85 | + If you can't grant these permissions to the oplog user, |
| 86 | + the Live Migration process will not work. In this case, use |
| 87 | + :atlas:`mongodump and mongorestore </import/mongorestore/>` to migrate |
| 88 | + your data to Atlas. |
| 89 | + |
| 90 | + .. step:: Review migration steps. |
| 91 | + |
| 92 | + Read through the overview of migration steps in the Live Migration |
| 93 | + dialog window, then click the green :guilabel:`I'm ready to migrate` |
| 94 | + button. |
| 95 | + |
| 96 | + .. step:: Add IP address ranges to your Compose deployment whitelist. |
| 97 | + |
| 98 | + .. procedure:: |
| 99 | + :style: connected |
| 100 | + |
| 101 | + .. step:: Open two browser tabs: |
| 102 | + |
| 103 | + - For the Atlas Live Migration process dialog from the previous step. |
| 104 | + - For your Compose deployment dashboard. |
| 105 | + |
| 106 | + .. step:: On your Compose deployment dashboard, click the :guilabel:`Security` |
| 107 | + link in the left-side navigation. The :guilabel:`Whitelist TCP/HTTP |
| 108 | + IPs` section displays a list of IP address ranges which are allowed |
| 109 | + to access your Compose deployment. |
| 110 | + |
| 111 | + .. step:: Add the IP address range which is listed at the top of the |
| 112 | + Atlas Migration process dialog window. |
| 113 | + |
| 114 | + .. figure:: /images/compose-add-ips.png |
| 115 | + :figwidth: 700px |
| 116 | + :alt: Shows IP address range entered in the Whiltelist TCP/HTTP |
| 117 | + IPs section. |
| 118 | + |
| 119 | + .. note:: |
| 120 | + Your Atlas migration IP address ranges may be different from |
| 121 | + those shown here. |
| 122 | + |
| 123 | + .. step:: Add the hostname and port of your Compose deployment to the |
| 124 | + Atlas Live Migration dialog. |
| 125 | + |
| 126 | + On the :guilabel:`Oplog Access` add-on page, you'll find a connection |
| 127 | + string with a hostname and port for oplog access. Copy them to the Atlas |
| 128 | + Live Migration dialog. |
| 129 | + |
| 130 | + .. figure:: /images/compose-hostname.png |
| 131 | + :figwidth: 650px |
| 132 | + :alt: Shows field filled in with a hostname and port. |
| 133 | + |
| 134 | + .. step:: Enter the oplog user's credentials in the Live Migration dialog. |
| 135 | + |
| 136 | + Enter the username and password for :guilabel:`oploguser` in the |
| 137 | + Atlas Live Migration dialog window. |
| 138 | + |
| 139 | + .. step:: Enter your Compose TLS/SSL Certificate data. |
| 140 | + |
| 141 | + If you don't have TLS/SSL enabled on your Compose deployment, skip this |
| 142 | + step. |
| 143 | + |
| 144 | + .. important:: |
| 145 | + |
| 146 | + In some Compose deployments, you can no longer view your TLS/SSL |
| 147 | + certificate in the Compose UI. If this is the case for your |
| 148 | + deployment, you have two options: |
| 149 | + |
| 150 | + - Contact Compose directly to request your TLS/SSL certificate. |
| 151 | + - Use :atlas:`MongoMirror </import/mongomirror/>` to migrate your data to Atlas. |
| 152 | + |
| 153 | + See the `Compose documentation |
| 154 | + <https://help.compose.com/docs/lets-encrypt-certificates>`__ for more |
| 155 | + information about SSL certificates. |
| 156 | + |
| 157 | + On the :guilabel:`Oplog Access` add-on page, you'll find an SSL |
| 158 | + certificate. Copy it to the CAFile text box on the Atlas Live |
| 159 | + Migration dialog. |
| 160 | + |
| 161 | + .. figure:: /images/compose-cafile.png |
| 162 | + :figwidth: 664px |
| 163 | + :alt: Shows an SSL certificate pasted into the CAFile text box. |
| 164 | + |
| 165 | + .. note:: |
| 166 | + Copy the entire certificate file, including the |
| 167 | + ``BEGIN CERTIFICATE`` and ``END CERTIFICATE`` lines. |
| 168 | + |
| 169 | + .. step:: Validate your Live Migration form. |
| 170 | + |
| 171 | + Click the :guilabel:`Validate` button to check that all your form |
| 172 | + fields are valid and your clusters are ready for migration. When your |
| 173 | + form is validated, you're ready to begin the migration. |
| 174 | + |
| 175 | + .. step:: Click :guilabel:`Start Migration`. |
| 176 | + |
| 177 | + A countdown timer in a progress bar indicates how much time remains |
| 178 | + before your target cluster is ready to migrate data from your source |
| 179 | + cluster. Wait until the countdown timer and the :guilabel:`Prepare to Cutover` |
| 180 | + button are green before proceeding to the next step. |
| 181 | + |
| 182 | + .. step:: Click :guilabel:`Prepare to Cutover`. |
| 183 | + |
| 184 | + .. step:: Perform the cutover. |
| 185 | + |
| 186 | + When Atlas detects that the source and destination clusters are nearly |
| 187 | + in sync, it starts an extendable 72 hour timer to begin the cutover |
| 188 | + procedure. If the 72 hour period passes, Atlas stops synchronizing with |
| 189 | + the source cluster. You can extend the time remaining by 24 hours by |
| 190 | + clicking the :guilabel:`Extend time` hyperlink below the :guilabel:`<time> |
| 191 | + left to cut over` timer. |
| 192 | + |
| 193 | + .. procedure:: |
| 194 | + :style: connected |
| 195 | + |
| 196 | + .. step:: Once you are prepared to cut your applications over to the |
| 197 | + destination Atlas cluster, click :guilabel:`Prepare to Cutover`. |
| 198 | + |
| 199 | + .. step:: Atlas displays a walk-through screen with instructions |
| 200 | + on how to proceed with the cutover. These steps are also outlined |
| 201 | + below: |
| 202 | + |
| 203 | + 1. Stop your application. This ensures that no additional writes |
| 204 | + are generated to the source cluster. |
| 205 | + |
| 206 | + #. Wait for the optime gap to reach zero. When the counter reaches |
| 207 | + zero, the source and destination clusters are in sync. |
| 208 | + |
| 209 | + #. Restart your application using the new connection string |
| 210 | + provided in step 3 of the Live Migrate cutover UI. |
| 211 | + |
| 212 | + .. step:: Once you are prepared to cut your applications over to the |
| 213 | + destination Atlas cluster, click :guilabel:`Prepare to Cutover`. |
| 214 | + |
| 215 | + .. step:: Once you have completed the cutover procedure and confirmed |
| 216 | + your applications are working normally with the Atlas cluster, |
| 217 | + click :guilabel:`Cut Over` to complete the migration procedure. |
| 218 | + This allows Atlas to: |
| 219 | + |
| 220 | + - Mark the migration plan as complete. |
| 221 | + - Remove the Application Server subnets from the destination |
| 222 | + cluster IP access list. |
| 223 | + - Remove the MongoDB user that Live Migrate used to import data |
| 224 | + to the destination cluster. |
| 225 | + |
| 226 | + |
| 227 | +Migration Support |
| 228 | +----------------- |
| 229 | + |
| 230 | +If you have any questions regarding migration beyond what is covered |
| 231 | +in this documentation, or if you encounter an error during migration, please |
| 232 | +see the Atlas documentation on |
| 233 | +:atlas:`requesting support </support/#request-support>`. |
| 234 | + |
| 235 | +Summary |
| 236 | +------- |
| 237 | + |
| 238 | +You created an Atlas cluster, migrated data from your old Compose cluster, and |
| 239 | +updated your applications to use the new Atlas Cluster. Congratulations and |
| 240 | +welcome to MongoDB Atlas! |
| 241 | + |
| 242 | +.. guide-next:: |
0 commit comments