5. Sync & Backup¶
SnippetsLab offers two options when it comes to synchronization–iCloud and third-party services. To change sync settings, select SnippetsLab > Preferences… from the main menu, then choose the Sync tab.
5.1. iCloud Sync¶
iCloud sync automatically stores all your data in the cloud, and makes them available to your other devices as long as they are signed in with the same Apple ID.
To enable iCloud sync for SnippetsLab, all of the following conditions must be met:
You’ve turned on iCloud services in macOS and signed in with a valid Apple ID
iCloud Drive is enabled in System Preferences > Apple ID
SnippetsLab is permitted to store documents into your iCloud account (in System Preferences > Apple ID > iCloud Drive > Options…, the corresponding checkbox for SnippetsLab must be selected)
Your computer has Internet access
Although SnippetsLab uses iCloud Drive for sync, it does not create an entry in the “iCloud Drive” folder in Finder. This is because unlike apps such as Pages or TextEdit, SnippetsLab maintains a single, opaque library, and does not utilize the “documents” architecture in which users can create and open any files of supported formats.
5.1.1. Turning on iCloud Sync¶
Below are some common issues that you may encounter when turning on iCloud:
“The iCloud library is being downloaded, please try again later.”¶
This means the system is currently downloading your iCloud library in the background. To ensure data consistency, you must wait until the download is complete before turning on iCloud (and opening the corresponding library). This is most likely to happen when using additional devices for the first time if you already have data synced to iCloud, or after a system reset/reinstall.
The time required to complete this initial download may vary based on your library size, network condition, as well as the current workload of the iCloud daemon. In most cases, it should complete within a few minutes.
“Do you want to upload your current library to iCloud?”¶
This message only appears if you have a nonempty library when enabling iCloud.
The local and iCloud libraries are completely separate. When iCloud is turned off, SnippetsLab stores your library in a local directory (which can be customized). When iCloud is turned on, SnippetsLab reads from and writes to iCloud directly. This message asks if you would like to copy the contents of your local library to iCloud.
If you have not used iCloud before, you may choose “Upload” to have your data migrated to the cloud automatically. However, if you are already syncing to iCloud (such as from another device or a previous installation), you may want to choose “Don’t Upload” to open the iCloud library directly. Choosing “Upload,” in this case, will override the existing iCloud library with your local content.
If you would like to merge your local library into an existing iCloud library, you may choose Library > Export to export a copy of your local library (in SnippetsLab Library format), and import it back after enabling iCloud.
5.1.2. Turning off iCloud Sync¶
If you turn off iCloud sync, SnippetsLab will close the cloud library, and open the local library instead. As a result, all contents stored in iCloud will disappear. Before actually turning off iCloud, however, SnippetsLab gives you an option to keep a separate, local copy of your cloud library.
After turning off iCloud on your Mac, you can still access your cloud library on your other devices using iCloud. If you turn iCloud sync back on, your iCloud library reappears.
5.2. Third-party Sync¶
To use a third-party file-based sync service like Dropbox or Google Drive, follow the steps below:
Choose SnippetsLab > Preferences… from the main menu, then open the Sync tab.
If iCloud sync is enabled, click on Turn Off.
Specifically, you might want to select Keep a copy of the snippets on this Mac to migrate your iCloud library.
Click on Move Library…, and choose a new location for your library that is managed by the sync service.
When using third-party sync services, SnippetsLab does NOT currently pickup changes on disk automatically until it is restarted. It is therefore recommended to avoid simultaneous edits from multiple devices to prevent any sync conflicts.
5.3. Managing Backups¶
SnippetsLab automatically keeps backups of your library on a daily basis when it is running. To manage or restore backups, choose SnippetsLab > Preferences… from the main menu, then open the Advanced tab.
Manually create a backup: Click Back Up Now.
Delete a backup: Choose Browse and Restore… from the Advanced window. In the appeared list of available backups, right-click the item you want to delete and select Delete…
Restore from a previous backup: Choose Browse and Restore from the Advanced window. Choose the version to restore from, and select Restore Selected…
Set a custom backup location: Click on the button on the right side from the Advanced window, and choose Move Backup Folder…. The existing backups will be migrated to the new location automatically.
It is strongly recommended that you specify a custom backup location in order to minimize the risk of the backup files being affected by either the system (when deleting the app) or any third-party “Mac cleaner”/”system cleaner” utilities.