
Building Admin — SharePoint File Sync Tool
A Python tool that backfills legacy Building Admin file attachments into SharePoint and BuildingCRM on demand, so existing floor plans, manuals, and logos land in the new system without anyone re-uploading them by hand.
Overview
- Project Name: Building Admin — SharePoint File Sync Tool
- Project Type: Legacy file migration & sync utility (Python)
- Source: Legacy Building Admin file share (per-attachment-type folders on a web server)
- Target System: SharePoint list + BuildingCRM (OXF_Attachments)
- Tech Stack: Python, SharePoint REST API, SQL Server, Pandas
- Status: Delivered
Building Admin 2.0 needed every attachment already sitting on the legacy web server — floor plans, site plans, manuals, logos, and more — to exist in the new SharePoint-backed system too, not just new uploads going forward. Rather than have someone manually re-upload years of files through the new interface one at a time, this tool reads the legacy file share directly, uploads anything missing straight into SharePoint, and writes the matching record back into BuildingCRM — so existing files land in the new system already linked. Built alongside Building Admin — Power Apps Rebuild, specifically to close that backfill gap.
Keeping BuildingCRM and SharePoint in step with what was actually on the file share used to mean waiting for whatever batch cadence was already scheduled. This tool runs on demand instead — point it at an environment and it reconciles the file share, SharePoint, and BuildingCRM in one pass, so a backfilled file is available immediately rather than on the next scheduled sync.
Architecture
File Matching
A JSON template defines every attachment type the tool understands — Floor Plans, Site Plans, Elevations, several Manuals subtypes (Emergency, Fire & Safety, Security, Sustainability, Tenant), Park and Racking Plans, Asset Logos, and more — each with its own filename regex and web-server subfolder. The matcher walks every folder, extracts the BU (and suite, where the filename encodes one) from each filename, and flags anything that doesn't match a known pattern as unmatched rather than silently skipping it.
Sync Pipeline
Every run reconciles three places in sequence: it diffs the matched files against what's already in the SharePoint list, creates a SharePoint item (with the file itself as an attachment) for anything missing, then refreshes the list and checks BuildingCRM for a matching attachment record by BU, type, and filename — inserting a new one or updating the existing one, and writing the resulting Request ID back onto the SharePoint item so the two stay linked.