Transfer Attachments to SharePoint
The SharePoint Connector includes functionality to transfer existing Business Central attachments to SharePoint. This page explains how to migrate your document attachments.
Transfer Overview
What is Transfer Attachments?
This feature moves attachments stored in Business Central's native attachment storage to SharePoint:
- Attachments currently stored in BC
- Moved to corresponding SharePoint folders
- Based on table mappings
When to Use
Use Transfer Attachments when:
- Implementing SharePoint Connector
- Migrating from BC attachments to SharePoint
- Consolidating document storage
- Moving historical documents
Prerequisites
Before Transfer
Ensure you have:
| Requirement | Status |
|---|---|
| SharePoint connection | Configured and tested |
| Table mappings | Set up for source tables |
| Destination folders | Exist in SharePoint |
| Permissions | Write access to SharePoint |
Required Mappings
Attachments transfer to the mapped table's SharePoint folder:
| Attachment On | Needs Mapping For |
|---|---|
| Customer | Customer table |
| Vendor | Vendor table |
| Item | Item table |
| Job | Job table |
Supported Tables
The report only supports tables whose primary key consists of a single field (such as Customer, Vendor, Item, and Job), plus two special cases: Sales Header (table 36) and Purchase Header (table 38). If an attachment belongs to any other table with a multi-field primary key, the report stops with an error.
Running the Transfer
Accessing Transfer Report
The report cannot be found with Tell Me search. Run it from the SharePoint Table Mapping pages:
- Open the SharePoint Table Mapping list or card
- Choose the Transfer Attachments to SharePoint action
Setting Filters
Configure what to transfer using the request-page filters on the Document Attachment table:
| Filter | Purpose |
|---|---|
| Table ID | Which table's attachments |
| No. | Specific records |
| Attached Date | Date range |
| Document Type / User | Further narrowing |
Running the Transfer
- Set your filters
- Click OK to run
- Report processes attachments
- Files are copied to SharePoint
- Progress may be displayed
Transfer Process
What Happens
For each attachment:
- Read attachment from BC storage
- Determine destination folder (from mapping)
- Upload file to SharePoint
- Continue to next attachment
The report only uploads -- it does not delete or modify the original BC attachment. The source attachment remains in Business Central after transfer; if you want to remove it, do so manually.
File Naming
Transferred files keep their original names, with name sanitizing applied:
- Filename passed through the connector's name sanitizing -- special characters not allowed by SharePoint are replaced
- Extension preserved
- No other renaming
Example Transfer
Customer Attachments
Transferring customer attachments:
- Run Transfer Attachments to SharePoint from the SharePoint Table Mapping page
- Filter: Table ID = 18 (Customer)
- Optionally filter specific customers
- Run the transfer
- Attachments appear in customer SharePoint folders
Result
Before: Attachment stored in BC on Customer record After: File in /Customers/[Customer Name]/filename.ext
Scale Considerations
Large Transfers
For many attachments:
| Consideration | Recommendation |
|---|---|
| Time | Allow sufficient time |
| Batching | Process in smaller groups |
| Connectivity | Ensure stable connection |
| Timeouts | Monitor for failures |
Batch Processing
For large migrations:
- Filter by date range
- Or filter by record range
- Process in chunks
- Verify each batch
- Continue to next
Token Refresh
For long-running transfers:
- OAuth tokens may expire
- Connector handles refresh
- Very long transfers may need restarts
Error Handling
During Transfer
If any single upload fails, the entire run stops immediately with an error. Nothing is logged and no attachments are skipped -- the report simply aborts at the failing attachment.
| Scenario | Behavior |
|---|---|
| Single file fails | Entire run stops with an error |
| Connection lost | Entire run stops with an error |
| Unsupported table (multi-field primary key) | Entire run stops with an error |
After a Failed Run
- Fix the cause of the error (mapping, permissions, file, connectivity)
- If a specific record keeps failing, narrow the request-page filters to exclude it
- Re-run the report
The report does not keep track of which attachments have already been transferred, so a re-run processes every attachment matching the filters again. Files that already exist in the SharePoint folder are left untouched (they are not overwritten), so re-running is safe -- but narrowing the filters to the remaining records avoids unnecessary re-processing.
Common Errors
| Error | Cause | Resolution |
|---|---|---|
| Folder not found | Missing mapping | Create table mapping |
| Permission denied | SP permissions | Grant access |
| File too large | Size limits | Check file size |
| Network error | Connectivity | Check connection |
Verification
After Transfer
Verify the transfer:
- Open sample records in BC
- Check SharePoint FactBox
- Verify files appear
- Open files to confirm content
Checklist
| Check | Method |
|---|---|
| Files present | Look in FactBox |
| Content correct | Open and verify |
| All records | Spot check various records |
| Count matches | Compare totals |
Options and Settings
BC Attachment Retention
The Transfer Attachments report is upload-only -- the original attachment is never deleted or altered in Business Central. After a successful transfer the file exists in both places (BC storage and SharePoint). If you want to free BC storage, delete the BC attachments manually once you have verified the SharePoint copies.
Best Practices
Planning
- Inventory - Know how many attachments
- Test - Try small batch first
- Verify - Check results before continuing
- Communicate - Inform users
Migration Strategy
| Phase | Action |
|---|---|
| 1. Prepare | Set up mappings, test connection |
| 2. Pilot | Transfer one table/few records |
| 3. Verify | Confirm successful |
| 4. Expand | Transfer more tables |
| 5. Complete | Final verification |
During Migration
- Run during off-peak hours
- Monitor progress
- Be prepared to pause
- Document any issues
Post-Migration
- Verify completeness
- Train users on new location
- Consider disabling BC attachments
- Monitor SharePoint usage
Alternative: Manual Transfer
If automated transfer isn't suitable:
- Download attachments from BC
- Upload to SharePoint manually
- More control, more effort