Pause or Terminate Sync
On this page
Overview
If you want to disable Atlas Device Sync for your app, you can temporarily pause or permanently terminate it. You can also re-enable Device Sync after disabling it.
You can temporarily pause Device Sync if you need to pause your cluster. With a temporary pause, you can resume without resetting your Device Sync configuration or losing Device Sync metadata.
You can permanently terminate and re-enable Device Sync for troubleshooting or if you want to change your Device Sync configuration.
Pause Sync
You can pause Atlas Device Sync for a period of time without disabling it entirely. When you pause Device Sync, you stop syncing changes between Atlas and your application.
Pausing Device Sync rejects any incoming client connections. This means that pausing Atlas Device Sync for your App stops syncing changes for all clients.
To pause Device Sync from the client side, using logic that situationally pauses Device Sync during a session, see your preferred SDK:
After pausing Device Sync, you can re-enable it. Pausing Device Sync maintains the configuration settings and all of the Device Sync metadata, which contains the sync history. When you re-enable paused Device Sync, your clients can reconnect normally.
If your oplog rolls past the time that you paused Device Sync, you must terminate and re-enable Device Sync. For example, if you only keep 12 hours of oplog for your cluster, and you pause Device Sync for longer than 12 hours, you must terminate and re-enable Device Sync.
Terminating and re-enabling paused Atlas Device Sync for your App erases Atlas Device Sync metadata and requires you to specify configuration settings again. Clients must perform a client reset when they reconnect after Atlas Device Sync has been terminated. For more information, see: Terminate Sync.
Procedure
Resume Sync
After you have paused Atlas Device Sync, you can resume it to begin syncing again for all clients.
If your oplog rolls past the time that you paused Device Sync, you must terminate and re-enable Device Sync. For example, if you only keep 12 hours of oplog for your cluster, and you pause Device Sync for longer than 12 hours, you must terminate and re-enable Device Sync.
Terminating and re-enabling paused Atlas Device Sync for your App erases Atlas Device Sync metadata and requires you to specify configuration settings again. Clients must perform a client reset when they reconnect after Atlas Device Sync has been terminated. For more information, see: Terminate Sync.
Procedure
The process to resume Device Sync is the same as the process to re-enable Device Sync. However, when you pause Device Sync, Atlas App Services preserves your configuration settings and Device Sync metadata.
To re-enable Atlas Device Sync, follow the steps in the Enable Atlas Device Sync guide. You can skip the Configure Sync step.
Clients do not need to perform a client reset when reconnecting after a pause.
Terminate Sync
If you have enabled Atlas Device Sync, you may have to terminate and re-enable Atlas Device Sync under a few different circumstances:
- Altering a Partition-Based Device Sync configuration
- Switching between Device Sync modes. For instance, if you are switching from Partition-Based Device Sync to Flexible Device Sync
- An upgrade from a Shared Tier Atlas Cluster to a Shared or Dedicated instance
- A move to an Atlas cluster that is distributed across regions/cloud providers
- An upgrade to NVMe Atlas clusters
- An oplog rollover
- A paused Atlas Device Sync session on a shared tier cluster due to infrequent usage
- Troubleshooting, at the request of MongoDB Support
When you terminate and re-enable Atlas Device Sync, clients can no longer Sync. Your client must implement a client reset handler to restore Sync. This handler can discard or attempt to recover unsynchronized changes.
Procedure
Terminate Atlas Device Sync in your App to stop syncing data across devices.
Re-Enable Sync
After you have terminated Atlas Device Sync, you can re-enable it. Re-enabling Device Sync enables your App to begin syncing changes to Atlas again. After you re-enable Device Sync, your App begins accepting incoming client connections again. However, if a client had previously connected to your App before you terminated Atlas Device Sync, you must perform a manual client reset for that client to enable it to connect to Atlas App Services again.
Procedure
When you pause Device Sync, Atlas App Services preserves your configuration settings, and you can skip the Configure Sync step. When you terminate Device Sync, or when the oplog rolls past the time that you paused Device Sync, you must specify the configuration settings again.
To re-enable Atlas Device Sync, follow the steps in the Enable Atlas Device Sync guide.
If you are re-enabling Atlas Device Sync after you have terminated it, you must perform a manual client reset in your client applications: