Rclone Google Drive to OneDrive: Setup, Sync Commands & Workspaces
Rclone Google Drive to OneDrive sync is a command-line operation that transfers and synchronizes file hierarchies directly between Google Drive and Microsoft OneDrive remotes. While command-line replication bridges cross-cloud storage, production jobs hit API rate limits, file path constraints, and Google Workspace export quirks. Connecting both environments to an indexed workspace lets teams and AI agents query documents directly without maintaining brittle local replication scripts.
How to Configure Rclone Remotes for Google Drive and Microsoft OneDrive
Synchronizing directories across cloud providers with rclone creates an immediate operational divide between one-time migrations and automated agent pipelines. While command-line tools can mirror folder trees between Google Drive and Microsoft OneDrive, production transfers routinely stall on unexported Google Workspace documents, mismatched character constraints, and aggressive API request throttling from Google Drive and Microsoft Graph. Engineers attempting to bridge the two ecosystems to feed AI coding agents end up maintaining brittle cron jobs and intermediate disk caches, when the real requirement is unified, indexed retrieval across both providers.
Rclone Google Drive to OneDrive sync is a command-line operation that transfers and synchronizes file hierarchies directly between Google Drive and Microsoft OneDrive remotes. By establishing authenticated API connections to both services, rclone reads objects from Google Drive and writes them to Microsoft OneDrive without routing data through physical desktop sync clients.
+-------------------------------------------------------------------------+
| Rclone Command-Line Interface |
| (rclone copy / rclone sync / dry-run / TPS rate limiter) |
+-------------------------------------------------------------------------+
| |
(Google Drive REST API) (Microsoft Graph API)
(Dedicated Client ID) (Dedicated Client ID)
v v
+---------------------------------+ +---------------------------------+
| Google Drive | | Microsoft OneDrive |
| - Proprietary Docs & Sheets | --> | - 400-Character Path Limits |
| - Unique ID Object Hierarchy | | - POSIX Strict Unique Names |
| - Symlink-Style Shortcuts | | - Forbidden Character Checks |
+---------------------------------+ +---------------------------------+
Interactive Remote Setup with rclone config
Configuring rclone requires registering each cloud service as an independent remote endpoint within rclone's configuration file, located by default at ~/.config/rclone/rclone.conf.
To configure Google Drive, initiate the setup wizard in your terminal:
rclone config
- Enter
nto create a new remote, and name itgdrive. - When prompted for storage type, select
drive(or enter its corresponding list number). - Leave
client_idandclient_secretblank initially if testing, or supply your own project credentials to bypass shared rate limits. - For the access scope, enter
1for full access or2for read-only access (drive.readonly) if you only plan to pull files from Google Drive. - Leave the
root_folder_idblank to access the root directory, or paste a specific folder ID to restrict the remote to a single workspace. - When prompted for advanced configuration, enter
n. - For auto-config, select
yif you are on a desktop with a web browser. If working on a headless Linux server, selectnand runrclone authorize "drive"on a local machine to generate the verification token. - Confirm the configuration and save the remote.
Next, create the Microsoft OneDrive remote within the same interactive menu:
- Select
nfor a new remote and name itonedrive. - For storage type, select
onedrive. - Provide your custom application credentials if configured, or leave them blank for default authentication.
- When prompted for account type, select
1for standard Microsoft OneDrive Personal or2for OneDrive for Business and SharePoint. - Complete the browser-based OAuth authentication flow.
- Rclone queries Microsoft Graph to locate available drives. Select your personal drive or corporate drive from the detected options, then verify and save the configuration.
Preventing Rate Limits with Dedicated OAuth Client Credentials
The default rclone configuration relies on public client credentials shared across all community users. Because Google Cloud and Microsoft Entra ID calculate API quotas across client applications, using shared public credentials frequently leads to sudden HTTP 429 throttling errors during large file operations.
To guarantee dedicated throughput:
- Google Cloud Console: Create a project in the Google Cloud Console, enable the Google Drive API, configure the OAuth consent screen for internal or external users, and create an OAuth client ID configured as a Desktop app. Add your Client ID and Client Secret to the
[gdrive]block in~/.config/rclone/rclone.conf. - Microsoft Entra ID: Navigate to the Microsoft Entra admin center, register a new application, set the redirect URI to
http://localhost:53682/, and grant the application delegatedFiles.ReadWrite.Allpermissions. Add the resulting Application (Client) ID and secret to the[onedrive]remote.
Using dedicated client IDs isolates your data transfers from external community traffic and raises API availability.
Related guides
- How to Connect Google Drive to AnythingLLM for Agentic RAGConnecting Google Drive to AnythingLLM provides local and team LLMs with direct access to cloud documents for grounding...
- How to Connect Microsoft AutoGen Agents to Google DriveAn AutoGen Google Drive connector registers retrieval functions with AutoGen agents so multi-agent group chats can...
- Can ChatGPT Access Google Drive? Permissions, Limits & WorkaroundsChatGPT can access Google Drive files through its native integration, but only by retrieving individual user-selected...
- Can Gemini Access Google Drive? Extension Limits, Permissions, and MCP SearchGoogle Gemini connects to Google Drive through the Google Workspace extension (@Google Drive) for conversational...
- ChatGPT Google Drive Connector: Native Connected Apps vs. Fast.ioA ChatGPT Google Drive connector links OpenAI models to cloud document repositories, enabling conversational search,...
- ChatGPT OneDrive Connector: Native Connected Apps vs. Fast.io WorkspacesA ChatGPT OneDrive connector links OpenAI models to documents stored in Microsoft OneDrive, enabling conversational...
More on this subject: Agent Integrations and APIs (171 guides)
How to Execute Transfer Commands: Copy vs Sync vs Dry Run
Selecting the correct command syntax is critical when moving data between Google Drive and OneDrive. The choice between rclone copy and rclone sync determines whether existing destination files remain safe or risk permanent deletion.
Understanding Copy Versus Sync Operations
The difference between copy and sync governs how rclone reconciles discrepancies between the source and target remotes:
rclone copy: Copies missing and updated files from Google Drive to OneDrive. Files that exist on OneDrive but not in Google Drive remain completely untouched. This is the safest approach for migrations, multi-source consolidation, and incremental backups.rclone sync: Forces the destination path on OneDrive to match the source path on Google Drive exactly. If a file exists in the destination OneDrive directory but is absent from the source Google Drive folder, rclone permanently deletes that file from OneDrive.
Because rclone sync performs destructive deletions on the destination, running an initial dry run is mandatory before executing a sync command.
Safe Verification with Dry-Run Commands
The --dry-run flag instructs rclone to simulate the entire transfer without modifying files, creating directories, or deleting destination records. It logs every action that would occur during an actual run.
Execute a dry-run test to inspect the planned changes:
rclone sync gdrive:Engineering/ onedrive:Engineering/ \
--dry-run \
--log-file=rclone-dryrun.log \
--log-level=INFO
Review rclone-dryrun.log to confirm that destination files marked with NOTICE: ...: Deleted represent intentional cleanups rather than accidental deletions of critical documents.
Running an Optimized Production Transfer
Once verified, run the production transfer with performance and logging flags tailored for cross-cloud network transfers:
rclone copy gdrive:Engineering/ onedrive:Engineering/ \
--transfers 4 \
--checkers 8 \
--tpslimit 10 \
--tpslimit-burst 10 \
--fast-list \
--progress \
--log-file=rclone-transfer.log \
--log-level=INFO
Tuning Concurrency and Bandwidth Flags
Configuring transfer parameters ensures maximum throughput while honoring upstream API limits:
--transfers 4: Controls the number of parallel file payloads transferred simultaneously. Setting this value between 4 and 8 balances bandwidth utilization without triggering connection resets.--checkers 8: Dictates how many parallel threads check file metadata (size and modification time) between Google Drive and OneDrive.--tpslimit 10and--tpslimit-burst 10: Restricts rclone to a maximum of 10 transactions per second (TPS). This flag prevents API quota spikes that trigger HTTP 429 backoff responses from Microsoft Graph and Google Drive.--fast-list: Instructs rclone to load directory listings into memory using fewer API calls. This reduces total HTTP transactions and speeds up operations across large folder trees.
How to Handle Google Drive Shortcuts, Export Formats, and Path Restrictions
Direct cross-cloud synchronization exposes significant structural incompatibilities between Google Drive and Microsoft OneDrive. Google Drive operates on an object-based storage model where files are indexed by unique internal identifiers, whereas OneDrive uses a strict hierarchical file system governed by Windows and SharePoint file-naming rules. Overcoming these incompatibilities requires explicit rclone configuration flags.
Dereferencing Google Drive Shortcuts
Google Drive uses shortcuts as pointer objects that reference target files stored elsewhere in personal folders or Shared Drives. In standard rclone operations, rclone treats shortcuts as pointer records rather than downloading the referenced target file. When copied to OneDrive, these shortcuts become unreadable 0-byte stubs or metadata files that cannot be opened.
To resolve target files during migration, pass the shortcut copy flag:
rclone copy gdrive:Projects/ onedrive:Projects/ \
--drive-copy-shortcut-content \
--transfers 4 \
--progress
When --drive-copy-shortcut-content is enabled, rclone dereferences the pointer, fetches the underlying binary data from the target file, and writes the complete file payload into the destination OneDrive folder. If you prefer to omit shortcuts entirely to avoid duplicating shared team assets, use --drive-skip-shortcuts instead.
Exporting Proprietary Google Workspace Documents
Google Docs, Sheets, and Slides do not exist as static binary files. They are live cloud documents that Google Drive stores as proprietary internal data structures. Attempting to copy a Google Doc directly without export rules results in skipped files.
Rclone handles this conversion automatically using the --drive-export-formats parameter, which defines target formats in priority order:
rclone copy gdrive:Documents/ onedrive:Documents/ \
--drive-export-formats docx,xlsx,pptx,svg \
--transfers 4 \
--progress
With this setting, Google Docs export as Microsoft Word documents (.docx), Google Sheets convert to Microsoft Excel spreadsheets (.xlsx), and Google Slides export as PowerPoint presentations (.pptx). Rclone automatically appends the correct file extension upon writing the file to OneDrive.
Managing OneDrive 400-Character Path Limits and Filename Rules
Microsoft OneDrive enforces strict limits on path lengths and character sets that do not exist in Google Drive. The entire path, including the file name, must contain fewer than 400 characters for OneDrive, OneDrive for Business and SharePoint Online.
When rclone encounters a path exceeding 400 characters, Microsoft Graph rejects the file with an invalidRequest: pathIsTooLong error. Path calculations must account for URL encoding: characters such as spaces, commas, and non-ASCII symbols expand into multiple characters when encoded (for example, a space becomes %20), accelerating path length exhaustion in deeply nested folder structures.
Furthermore, OneDrive prohibits specific characters in folder and file names:
- Prohibited characters:
",*,:,<,>,?,/,\,| - Trailing characters: File and folder names cannot end with a period (
.) or a space. - Reserved Windows system names:
AUX,COM1throughCOM9,CON,LPT1throughLPT9,NUL, andPRNcannot be used as file names or directory components.
Google Drive permits all of these characters in file titles. When synchronizing without sanitization, files with invalid characters fail to upload. Restructuring deeply nested folders and renaming non-compliant files prior to transfer prevents unexpected sync halts.
Resolving Duplicate Filenames in Google Drive
Because Google Drive tracks files by unique object IDs rather than paths, users can create multiple distinct files with the exact same name within the same folder. A single Google Drive folder can hold three separate files named report.pdf, each with distinct timestamps and contents.
OneDrive follows standard file system conventions where file paths must be strictly unique within any given directory. When rclone attempts to copy multiple files with identical names into OneDrive, it halts with duplicate object errors or overwrites earlier files.
To resolve duplicates before transferring data, run rclone's deduplication utility against the Google Drive source:
rclone dedupe gdrive:SharedFolder/ --dedupe-mode rename
The --dedupe-mode rename flag appends incremental numerical suffixes (such as report.pdf and report.1.pdf) to identical files, ensuring every file receives a distinct name that can be safely written to OneDrive.
Connect Google Drive and OneDrive to Autonomous Agent Workspaces
Keep your files in your existing cloud storage while agents search, index, and co-edit documents over remote MCP without local sync bottlenecks. Monthly plans start with a 14-day free trial.
Why Manual CLI Replication Stalls Autonomous AI Agent Pipelines
Developers and system administrators frequently implement rclone synchronizations between Google Drive and OneDrive to feed enterprise documents to AI coding agents, autonomous research workflows, and local large language models. A common architecture involves scheduling hourly or daily cron jobs that mirror Google Workspace assets into OneDrive, which is then mounted or queried by developer tools.
While this pattern functions for periodic administrative backups, relying on manual CLI replication creates severe bottlenecks when applied to autonomous agent execution.
Manual Scripted Replication:
+--------------+ (rclone sync cron) +--------------+ (Local Sync/Mount) +-----------------+
| Google Drive | ===========================> | OneDrive | ===========================> | Local Disk Pool |
+--------------+ - Silent path skips +--------------+ - Disk storage bloat +-----------------+
- API throttling (429) - Broken headless tokens |
- Unexported doc formats v
+-----------------+
| AI Coding Agent |
| (Context Bloat) |
+-----------------+
Fragility of Headless Token Refreshes and Cron Jobs
Automating rclone transfers via background cron jobs or Docker containers requires long-lived OAuth refresh tokens. Both Google Cloud and Microsoft Entra ID enforce security policies that revoke refresh tokens under various conditions:
- Enterprise Token Expiration: Corporate Entra ID tenants frequently enforce Conditional Access policies that expire user tokens every 24 hours to 90 days.
- Password Resets and Policy Adjustments: Routine security credential updates instantly invalidate active rclone refresh tokens.
- Unattended Failures: When a token expires in a headless environment, rclone exits with an authorization error. The scheduled job fails silently, leaving downstream agents operating on obsolete data without alerting the engineering team.
Context Window Exhaustion from Raw File Ingestion
When AI agents query local directories populated by rclone replication, they typically ingest entire documents into their context window. An agent searching for a single billing term or compliance clause reads full multi-megabyte PDFs, presentations, and spread sheets directly into memory.
This approach introduces compounding penalties:
- Token Wastage: Parsing raw binary dumps or entire converted documents consumes hundreds of thousands of context tokens for trivial lookups.
- Context Degradation: Large raw document payloads introduce context noise, reducing the model's reasoning precision across complex coding and analysis tasks.
- Execution Latency: Agents waste time reading, serializing, and buffering large files that contain only a fraction of relevant information.
Stale State and Split-Brain Synchronization Conflicts
Cross-cloud synchronization through periodic rclone runs introduces latency between the instant a human edits a document in Google Drive and when that update lands in OneDrive. If an autonomous agent writes updates back to OneDrive while a teammate edits the original file in Google Drive, the next scheduled sync execution encounters conflicting file states.
Without integrated version tracking and transactional conflict resolution across providers, bi-directional rclone sync jobs risk overwriting teammate contributions or reverting agent generated documentation.
Unified Agent Workspaces: Fastio Cloud Sync and Remote MCP Integration
Rather than writing complex bash scripts, debugging headless OAuth tokens, and managing duplicate cloud copies, modern engineering teams decouple storage from execution using an intelligent workspace layer. Fast.io provides shared, org-owned workspaces that connect directly to existing enterprise storage providers while exposing an indexed retrieval layer to autonomous AI agents.
Modern Indexed Workspace Architecture:
+-------------------+ +--------------------+
| Google Drive | | Microsoft OneDrive |
| (Cloud Import) | | (Cloud Sync) |
+-------------------+ +--------------------+
| |
+--------------+-------------+
|
v
+----------------------------------+
| Fast.io Workspace |
| - Hybrid Full-Text & Semantic |
| - Metadata Views Extraction |
| - Per-File Version History |
| - Append-Only Audit Log |
+----------------------------------+
|
(Streamable HTTP /mcp /sse)
|
v
+----------------------------------+
| Autonomous Agent |
| (Claude Code / Cursor / Cline) |
| - Precise semantic queries |
| - Zero raw file token waste |
| - Citation-backed excerpts |
+----------------------------------+
Keeping Existing Cloud Storage Intact
With Fast.io, teams do not migrate away from their existing cloud investments. Files remain in Google Drive and Microsoft OneDrive where humans collaborate every day:
- OneDrive Document Libraries: Fast.io Cloud Sync establishes one-way or two-way synchronization for Google Drive, OneDrive, Box, and Dropbox folders, running on a scheduled interval or executed on demand (synchronization is not continuous, live, or real-time). SharePoint libraries connect through the OneDrive connector.
- Google Drive Integration: Google Drive files can be pulled directly into Fast.io workspaces using cloud import, and Google Drive folders sync like Dropbox, Box, and OneDrive.
This architecture eliminates the need for intermediate staging servers or local rclone cron daemons.
Hybrid Semantic Indexing and Citation-Backed Retrieval
When files land in a Fast.io workspace, Intelligence Mode automatically indexes documents for hybrid search, combining full-text search, semantic vector retrieval, and search-by-metadata-value.
Instead of an agent downloading an entire multi-megabyte engineering brief to find an API endpoint definition, the agent queries the workspace and retrieves concise, relevant passages accompanied by verifiable document citations. This protects the agent's context window, maintains reasoning speed, and eliminates token bloat.
Connecting Agents via Remote MCP
Autonomous tools like Claude Code, Cursor, Cline, OpenClaw, and custom LLM applications connect to Fast.io through its consolidated Model Context Protocol server. Fast.io exposes Streamable HTTP at https://mcp.fast.io/mcp/code for coding agents and https://mcp.fast.io/mcp/tools for general MCP clients, with setup steps detailed in the Fast.io documentation.
Because the MCP server is hosted remotely, agents do not run local background daemons or compile binary packages. For example, adding Fast.io to Claude Code or Cursor requires only pointing the client configuration to the remote endpoint:
{
"mcpServers": {
"fastio": {
"url": "https://mcp.fast.io/mcp/code"
}
}
}
Interactive clients sign in with OAuth in the browser and carry no API key in configuration. Sign-in shows a Review Permissions screen where the person picks Read Only or Read & Write and which organizations and workspaces the connection can reach. Through this single connection, agents can search documents across Google Drive and OneDrive, inspect structured document extraction schemas created with Metadata Views, and coordinate with teammates using Collaborative Notes.
In the published connector benchmark, Fastio was measured the fastest and the lowest cost of the providers tested. Developers evaluating agent infrastructure can review cloud import capabilities and Fast.io AI architecture.
Granular Governance and Multi-Agent Protection
Fast.io provides enterprise governance controls designed specifically for environments where humans and AI agents work together:
- Per-File Version History: Every document modification creates a distinct historical version. If an agent produces an unintended edit, human teammates can inspect and restore previous file versions immediately.
- Append-Only Audit Log: All file reads, uploads, shares, and agent interactions are recorded in an immutable audit trail, providing complete compliance visibility.
- Advisory File Locks: Agents operating via the MCP
storage_managetool can acquire advisory per-file leases (lock-acquireandlock-release, whilelock-statuschecks lease state onstorage) to signal active editing and prevent conflicting concurrent writes. - Ownership Transfer: Developers and autonomous agents can scaffold an entire workspace, import necessary documentation, configure share portals, and cleanly transfer organizational ownership to a client or team manager while maintaining administrative access.
Teams can get started with a 14-day free trial on monthly plans (credit card required). Dedicated storage for agents and workspaces provide persistent, indexed memory that scales with team and agent workloads.
Sources
References used to verify factual claims in this guide.
-
The entire path, including the file name, must contain fewer than 400 characters for OneDrive, OneDrive for Business and SharePoint Online.
Frequently Asked Questions
How do I transfer files from Google Drive to OneDrive using rclone?
To transfer files between Google Drive and OneDrive using rclone, configure both services as remotes using the rclone config command. Once configured, execute rclone copy gdrive:SourceFolder onedrive:TargetFolder --transfers 4 --progress. Using copy instead of sync ensures existing files on OneDrive remain safe from accidental deletion while new files are moved.
What is the best rclone command to sync Google Drive with OneDrive?
The most reliable command for synchronizing Google Drive to OneDrive is rclone copy gdrive: onedrive: --transfers 4 --checkers 8 --tpslimit 10 --tpslimit-burst 10 --drive-export-formats docx,xlsx,pptx --drive-copy-shortcut-content --fast-list --progress. This command sets safe transaction rate limits, converts proprietary Google Workspace documents into standard Office formats, and resolves shortcut pointers into complete files.
How do I prevent rate limits when moving files with rclone?
Prevent rate limits by creating custom OAuth client credentials in the Google Cloud Console and Microsoft Entra ID rather than using rclone's default public client ID. In your CLI commands, include --tpslimit 10 and --tpslimit-burst 10 to restrict transactions to 10 requests per second, which prevents triggering HTTP 429 throttling from Google Drive and Microsoft Graph APIs.
What happens to Google Docs and Sheets during an rclone transfer to OneDrive?
Google Docs, Sheets, and Slides cannot be downloaded as binary files because they exist as cloud data structures. By default, rclone exports them to docx, xlsx, and pptx formats when downloading. You can explicitly customize exported formats using the --drive-export-formats flag so they open natively in Microsoft Office applications on OneDrive.
Why does rclone fail with path length errors when copying to OneDrive?
Microsoft OneDrive and SharePoint Online enforce a strict limit of fewer than 400 characters for the entire URL-encoded file path, including folder names and the file name. Google Drive does not enforce this limit. Deeply nested directories or folder names containing special characters expand when URL-encoded, causing Microsoft Graph to reject the file with pathIsTooLong errors.
How do AI agents access files across Google Drive and OneDrive without running rclone?
AI agents can access files across both clouds by connecting to an intelligent workspace platform like Fast.io via the Model Context Protocol. Google Drive and OneDrive folders sync directly into the workspace. The workspace auto-indexes content for hybrid semantic search, allowing agents like Claude Code or Cursor to retrieve precise excerpts via remote MCP without maintaining local rclone replication scripts.
Related Resources
Connect Google Drive and OneDrive to Autonomous Agent Workspaces
Keep your files in your existing cloud storage while agents search, index, and co-edit documents over remote MCP without local sync bottlenecks. Monthly plans start with a 14-day free trial.