Rails migration: leaving InventoryBase while staff work
Moving a live platform to Rails: replacing the sync service, importing the old database and checking records before source deletion, while staff keep working.
A property inventory agency asked me to move 14 years of inspection history out of InventoryBase into a Rails platform it owns outright. That's over 25,000 properties, more than 60,000 inspections, and over 4 TB of reports and photographs. Staff used the system every day, so there was no quiet weekend to shut everything down.
The agency wanted three things: lower long-term hosting cost on a third-party platform, full ownership of its records, and a complete backup it controlled. None of those felt urgent in isolation, yet every extra year of inspections made the eventual move larger. Sitting in front of that archive was a bigger immediate risk: an unfinished sync service a previous freelancer had built between InventoryBase and the team's Airtable base. It worked most days, failed silently on others until someone noticed and re-ran jobs by hand, and kept a partial copy of records that couldn't serve as a real backup.
Take over the live work before touching the history
I started with the live sync even though the 14-year archive was the louder project. The new Rails app took over everything the old service did: receiving changes from InventoryBase and Airtable, keeping both in step, and writing back only the small set of fields staff were allowed to edit from Airtable. Once that ran cleanly in production, we switched off the old sync service and imported its database into Rails.
Taking over live traffic first removed the riskiest dependency before the long backfill began, and it proved the new platform under real daily load. Every incoming change now arrives as a signed webhook and gets persisted before processing; if a job fails, it lands in a dead-letter list where we can inspect and replay it, which the old service never supported.
Import one record at a time and make it resumable
An InventoryBase inspection isn't a single row. The importer pulls each property with its contacts, meters, and photos, then pulls each inspection with its report, report details, contacts, and attachments across 14 inspection types, working 50 records per page.
For every record, the app stores the raw source payload before projecting it into canonical Rails tables. Keeping the raw JSON costs storage, yet it means any question about migrated data can be checked against what InventoryBase actually sent long after the account closes. The importer only advances its bookmark once a record finishes cleanly, skips anything already done, and leaves the bookmark alone on failure; I can stop a run, deploy a fix, and resume without duplicating rows. Records match on InventoryBase IDs, and a timestamp guard stops an older import from overwriting a newer change that arrived via webhook while the backfill was running.
Respect the rate limits
InventoryBase caps account request volume, and tripping that ceiling locks out staff who are trying to work in the same account that morning. The importer paces itself well under the limit (40 requests a minute for slow historical backfills) and honours Retry-After on 429s or transient 5xx errors, retrying up to four times with logged backoff. Airtable needed the same care at five requests a second, so the platform pauses between pages and flags a run as partial if Airtable's pagination cursor expires.
Treat photos as their own migration
More than 11 million files made photo migration the largest part of the work, and media fails differently from database rows. Some files already sat in the agency's older object storage and could be adopted by matching filenames; the rest had to be downloaded from InventoryBase, and any filename that matched multiple candidates was flagged for human review so the wrong photo never got attached to a property.
Media jobs ran on isolated queues away from webhook processing so a heavy download batch never stalled live sync updates. I've written more about splitting the read-write current bucket from the read-only legacy bucket in hosting is a trust problem.
Prove it before you delete anything
Nothing gets deleted from InventoryBase until every property passes a per-record check against the source across its reports, report details, PDFs, meter readings, and photos. Those checks run with read-only credentials, paced so they don't compete with daily traffic. Deletion happens only in verified batches (a few thousand records have been removed so far).
Keeping the live sync separate from the archive, storing raw payloads next to canonical rows, pacing every API call, and defining what "done" means per record before touching delete is what lets a 14-year migration happen while the business keeps running. The platform is live. The team uses it daily, and I still maintain it.