OneDrive Sync

approved

by Jeff Steinbok

Sync your Obsidian vault with OneDrive Personal/Consumer - This plugin has not been manually reviewed by Obsidian staff.

โ˜… 42 starsโ†“ 5,798 downloadsUpdated 9d agoMIT

Obsidian OneDrive Sync

CI License Obsidian

Social Preview

Sync your Obsidian vault with OneDrive Personal accounts. Zero-config, mobile-friendly, battery-efficient.

๐Ÿ“– How It Works ยท Troubleshooting ยท Advanced Usage ยท Development ยท Postmortem Process

[!TIP] ๐Ÿฆž OpenClaw Users - This pairs well with the ๐Ÿฆž๐Ÿš๐Ÿ“ Carapace Obsidian toolset when integrating these vaults with OpenClaw, so synced vault content can plug directly into your broader tool-driven workflow.

[!IMPORTANT] While I do work for Microsoft and on the OneDrive team, this plugin is in no way an official Microsoft plugin. Just a thing I needed and wanted to share. If you like it, give me a โญ. As a friend of mine says, "I'm only in it for the subs and likes.".

โœจ Features

  • Zero-Configuration โ€” No Azure AD app registration. Just click connect and authenticate.
  • Mobile-First โ€” Device Code Flow works on iOS and Android with no redirects.
  • Event-Driven Sync โ€” Syncs on file changes, not polling. Great for battery life.
  • Bidirectional โ€” Automatic two-way sync with configurable conflict resolution.
  • Two Access Modes โ€” App Folder (secure, isolated) or Full Access (shareable, flexible location).
  • Pull-Only Mode โ€” (Experimental) One-way sync from OneDrive for read-only vaults or backup recovery.

Why this over native OneDrive file sync?

  • Skips device-specific clutter โ€” workspace UI state files (.obsidian/workspace*.json) are intentionally excluded.
  • Faster content sync behavior โ€” sync is event-driven on vault file changes instead of waiting for generic file-system polling cycles.
  • Built-in merge/conflict handling โ€” choose overwrite, duplicate, or manual resolution instead of relying on last-writer-wins file sync behavior.

๐Ÿš€ Installation

Community Plugin Store (Recommended)

  1. Open Obsidian โ†’ Settings โ†’ Community Plugins โ†’ Browse
  2. Search for "OneDrive Sync"
  3. Click Install, then Enable

[!NOTE] Upgrading from 1.0.x? Version 1.1.0 uses a new Azure app registration. After updating, you'll need to disconnect and reconnect to OneDrive in the plugin settings. Your files in OneDrive are not affected โ€” the plugin will re-sync on first connection.

To clean up the old app authorization, visit account.live.com/consent/Manage, find the old entry (it may appear as "Obsidian OneDrive Sync by Jeff Steinbok"), and click Remove. You can also delete the old /Apps/Obsidian OneDrive Sync by Jeff Steinbok folder from your OneDrive if present.

Via BRAT (Beta Testing)

  1. Install BRAT from Community Plugins
  2. BRAT settings โ†’ Add Beta Plugin โ†’ JeffSteinbok/obsidian-onedrive
  3. To receive pre-release builds, enable "Enable beta versions" in the Add Beta Plugin dialog (BRAT installs only the latest full release otherwise). You can toggle this later per-plugin in BRAT's settings.

Manual

  1. Download main.js and manifest.json from the latest release
  2. Place them in .obsidian/plugins/onedrive-sync/
  3. Enable the plugin in Settings โ†’ Community Plugins

๐Ÿ”ง Setup

  1. Settings โ†’ OneDrive Sync โ†’ Connect to OneDrive
  2. Enter the displayed code at microsoft.com/devicelogin
  3. Sign in and grant permissions
  4. Done โ€” your vault syncs automatically!

Configuration

SettingDescription
Sync IntervalSet to 0 for manual-only sync (recommended for battery)
Startup Sync DelayDelay before first sync after launch (0 = disabled, 10s recommended)
Conflict ResolutionLast write wins (default), create duplicate, or manual
Sync App SettingsOptional โ€” sync .obsidian/app.json, .obsidian/appearance.json, and .obsidian/hotkeys.json to keep appearance and hotkeys consistent across devices
Sync PluginsOptional โ€” sync plugin lists, manifests, and binaries (main.js, styles.css). Does not sync plugin data files (data.json)
Sync CSS SnippetsOptional โ€” sync CSS snippets from .obsidian/snippets/ to keep custom styles consistent across devices
Sync BookmarksOptional โ€” sync .obsidian/bookmarks.json to keep bookmarks consistent across devices
Pull-Only Mode(Experimental) Download changes from OneDrive but never upload local edits. Useful for read-only vaults or backup recovery. Enable under Settings โ†’ Experimental
Debug LoggingEnable for troubleshooting. Writes a daily note under _OneDriveSyncLogs/YYYY-MM-DD.md (device-local, never synced), stamped with the plugin version and current config

For advanced settings (reset sync token, reconcile from cloud, custom client ID, experimental performance options), see Advanced Usage.

Commands

Available via the command palette (Ctrl/Cmd+P):

  • Sync now โ€” trigger a manual sync immediately
  • Connect to OneDrive / Disconnect from OneDrive โ€” manage authentication
  • Force full sync (re-download everything) โ€” clear sync state and re-pull all files from cloud
  • Reconcile from cloud (cloud-as-truth recovery) โ€” destructive recovery; see Reset vs. Reconcile below
  • Show sync conflicts โ€” open the conflict resolution view

Reset vs. Reconcile โ€” which one?

SymptomUse
"Plugin lost track of state, want a fresh re-read from cloud"Reset sync token
"Files I deleted on another device are still here"Reconcile from cloud
"I have files that pre-date the plugin and they need to be in cloud"Reset sync token
"Vault has cruft that doesn't exist in OneDrive โ€” wipe it"Reconcile from cloud

Reset sync token is upload-biased: local always wins, so any local-only file gets pushed to cloud on the next sync. Reconcile from cloud is the opposite: cloud always wins, local-only files get deleted (with a confirmation prompt for large deletes). Empty folders left behind by reconcile are pruned automatically โ€” except folders that also exist in OneDrive.

Files always excluded from sync

The plugin hardcodes these exclusions for safety:

  • .obsidian/plugins/onedrive-sync/ โ€” the plugin's own folder is always excluded to prevent syncing its data.json (which contains sync state and configuration) and to avoid self-downgrade scenarios where one device overwrites another's plugin binary. Authentication tokens are stored separately using Obsidian's SecretStorage API, not in data.json.
  • .obsidian/workspace*.json โ€” per-device UI state (Obsidian Sync excludes these too)
  • _OneDriveSyncLogs/ โ€” device-local debug logs

Optional: .syncIgnore

Create a .syncIgnore file at your vault root to exclude files/folders from sync. See Advanced Usage for details.

๐Ÿ”’ Access Modes

App Folder (Default)Full Access
PermissionsMinimal โ€” isolated app folderFull OneDrive access
ScopesUser.Read, Files.ReadWrite.AppFolder, offline_accessUser.Read, Files.ReadWrite.All, offline_access
Location/Apps/ObsidianOneDrive/Anywhere you choose
SharingNoYes โ€” share via OneDrive
BrowseableNot easilyYes โ€” visible in OneDrive web/app
Best forPersonal vaults, privacy-focusedShared/family vaults

To switch modes: Settings โ†’ OneDrive Sync โ†’ Access Mode, then disconnect and reconnect.

๐Ÿ‘ฅ Sharing Your Vault (Full Access Mode)

  1. Enable Full Access mode and set your sync folder path (e.g., /Documents/MyVault)
  2. In OneDrive web/app, share that folder with others ("Can edit")
  3. They don't need the plugin! They just use OneDrive's native sync:
    • Desktop: Accept the share โ†’ OneDrive syncs locally โ†’ open folder as vault in Obsidian
    • Mobile: Accept the share โ†’ "Make available offline" in OneDrive app โ†’ open as vault

Tip: Use "Create duplicate" conflict resolution to avoid overwriting each other's changes.

๐Ÿ“ฑ Mobile Support

This plugin is designed with mobile as a primary target:

  • Device Code Flow โ€” no custom URL schemes or redirects needed
  • Event-Driven Sync โ€” only syncs when files change (battery-efficient)
  • iOS: Use Safari to complete authentication
  • Android: Use Chrome or your default browser

Security & Privacy

  • Authentication tokens (OAuth access and refresh tokens) are stored using Obsidian's SecretStorage API, which keeps them outside of data.json and in a platform-appropriate secure store. They are never written to files that could be accidentally synced or exposed.
  • The plugin's own folder (.obsidian/plugins/onedrive-sync/) is always excluded from sync. Even though tokens are no longer in data.json, the exclusion remains to prevent self-downgrade (one device overwriting another's plugin binary) and to keep device-specific sync state separate.
  • No data leaves your OneDrive โ€” the plugin communicates directly with Microsoft Graph. There is no intermediary server.
  • Vault file enumeration โ€” the plugin reads your vault's file list to determine what to sync. This is inherent to any sync tool, but the information never leaves your device except as uploads to your own OneDrive.

For plugin developers

Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.