The independent daily for Salesforce admins, developers and architects

Curated by Abhinav (opens in a new tab)

Testing a HubSpot to Salesforce migration with Node.js and MongoDB staging (opens in a new tab)

The reader will learn how a staging layer in MongoDB can support reconciling activity counts and verifying note-to-record links before a CRM cutover.

Why read this

They also get practical checks for dates and fields and a view of what evidence to require before go-live.

  1. HubSpot to MongoDB archive
  2. MongoDB to Google Sheets timelines
  3. Reviewed records to Salesforce
The migration ran in three stages, each with its own check

A team migrating sales data from HubSpot to Salesforce used Node.js to copy HubSpot records into MongoDB, keeping change history so that a source version could be checked when a batch looked wrong. Google Sheets timelines for companies and contacts let the sales team review relationship histories before the move. The archive held 23,684 activities across emails, calls, meetings, messages, notes and tasks.

Because an activity can appear on both a company timeline and a contact timeline, summing rows across those views would double-count. The article gives an aggregation that groups by activity type and HubSpot ID first, so each activity is counted once, and recommends checking for missing source IDs before the count. A matching grand total can still hide a missing call and an extra email, so counts should be compared type by type.

For notes, the article traces a note from HubSpot’s note body and timestamp fields to Salesforce native notes, where ContentDocumentLink.LinkedEntityId shows which records the note is attached to. A worked example compares expected and actual parent IDs to identify missing and misplaced links. It also separates the conversation date, the creation date and the last-edited date, and warns that an import can leave them inconsistent unless audit fields and permissions are set correctly.

The article says 113 automated tests had passed and that Salesforce test batches had been compared record by record, but the full production cutover was still ahead. It proposes three checks for the final change window: reconcile counts by type, resolve or accept every mapping difference, and have a sales rep find a known conversation with ordinary access.

Read the original at dev.to (opens in a new tab)

Worth reading?