Box to Cross-Cloud Migration
On demand or scheduled, the flow migrates files from Box to another cloud store (OneDrive/SharePoint/Dropbox), tracking a migration map to resume and avoid duplicates, and reporting progress and failures. Automates controlled cross-cloud file migration.
Provided as-is, without warranty of any kind. Review and test each pattern in a non-production environment before deploying it to live automations. See our Terms.
Overview
This flow automates controlled, resumable file migration from Box to OneDrive for Business. On a schedule (or on demand), it lists files in a Box source folder, copies each new file to a OneDrive target root, records every copy in a Dataverse migration map (so the run can resume and never duplicates work), and posts a migrated / skipped / failed summary to Microsoft Teams.
Why it matters: manual cloud migrations are slow and error-prone. A tracked, idempotent, capped flow makes Box to Microsoft 365 migrations reliable, auditable, and safe to re-run.
Ships Off (demo).
Use Case
A team consolidating storage needs Box content migrated to Microsoft 365. The flow runs nightly, migrates a capped batch of files per run, and reports progress to the team's Teams channel. Because every copy is logged to the migration map, an interrupted run simply resumes on the next schedule without re-copying files that already landed.
Flow Architecture
Run On A Schedule
Recurrence (daily)Can be swapped for a manual trigger for on-demand runs.
Initialize Trace, Config & Counters
Initialize variableMints a correlation id; binds source root, target root, map table, Teams ids, the per-run cap (default 50), and migrated/skipped/failed counters.
List Box Source Folder
Box - ListFolderReturns the source folder items (capped via take()).
Check Already Migrated
Microsoft Dataverse - ListRecordsLooks up the migration map by source file id + Migrated status for resume/dedup.
Migrate File (try/catch)
Box GetFileContent + OneDrive CreateFile + Dataverse CreateRecordDownloads from Box, uploads to OneDrive (auto-creates the path), and records a Migrated row; a catch block logs a Failed row so the file retries next run.
Post Migration Report To Teams
Microsoft Teams - PostMessageToConversationPosts migrated / skipped / failed counts and the correlation id.
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_SourceRootId | String | 0 | Box source folder id to migrate (0 = All Files root). |
| flowlibs_TargetRoot | String | /Migrated | OneDrive for Business destination root path. |
| flowlibs_MigrationMapTable | String | flowlibs_boxmigrationmaps | Dataverse entity-set name of the migration map table. |
| flowlibs_TeamsGroupId | String | <your-team-id> | Teams team (group) id for the report. |
| flowlibs_TeamsChannelId | String | <your-channel-id> | Teams channel id for the report. |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| Box | shared_box | ListFolder GetFileContent |
| OneDrive for Business | shared_onedriveforbusiness | CreateFile |
| Microsoft Dataverse | shared_commondataserviceforapps | ListRecords CreateRecord |
| Microsoft Teams | shared_teams |
Customization Guide
Almost every realistic variant of this flow can be implemented by changing environment variable values. A few cases require small edits inside the flow definition — those are called out explicitly below.
- Deep hierarchy / recursion
- This build migrates one folder level. To mirror an entire Box tree, call a child flow per subfolder (or push folder ids onto an Azure Queue and process with a Do-until), reusing the same migration map.
- Different target store
- Swap the OneDrive CreateFile action for SharePoint CreateFile or Dropbox CreateFile; the rest of the logic is unchanged.
- Metadata carry-over
- Add Box GetFileMetadata and write extra columns into the map / target file properties.
- Permissions mapping
- Extend with a step mapping Box collaborators to M365 sharing (Box has no connector collaboration op, so use built-in HTTP).
- Throughput
- Raise or lower the per-run cap; keep the loop sequential so counters stay accurate.
Key Expressions
The flow is intentionally light on Power Fx / WDL gymnastics — the heaviest expressions are the branch-name concatenation and the approval outcome check. They are listed below in the order they appear in the flow.
EXPR.01Capped, null-safe item list
Throttles files per run.
EXPR.02Is a file (not a folder)
Only files are migrated.
EXPR.03Already migrated?
Resume/dedup test.
EXPR.04Target path
OneDrive destination path.
Comments
Sign in to join the conversation.
Sign inNo comments yet. Be the first to share your experience with this flow.