Data Migration journey with Google Premium

Lessons from a Cloud Data Migration journey with Dynamics 365 and Google Premium.
Status: Completed Read year: 2025
Data Migration Journey with Google Premium - Image generated by Copilot AI with GPT-5
Data Migration Journey with Google Premium - Image generated by Copilot AI with GPT-5
Finally, the "Listener" had to establish communication with Google’s Web services and for that purpose , a security token ("Token") had to be generated and the refresh of that "Token" was also generated during the transaction.
For further information, the Google API Web service uses the OAuth 2.0 "Framework" which specifies several types of authorization (Refresh Token, Client Credentials, etc.). - Page 5.

Purpose

The whitepaper explains how to troubleshoot and resolve OAuth2 token refresh issues during a data migration from Dynamics CRM (on-premises) to Google Premium (Google Cloud Service) using Google API.


Context

  • Architecture: Dynamics CRM → MSMQ (Microsoft Message Queue) → Windows Service (“Listener”) → Google API (OAuth2).
  • Goal: Transfer CRM accounts and contacts to Google Premium directories.
  • Authentication: Based on OAuth 2.0 (Refresh Token, Client Credentials).

Problem

  • Error: “Failed to refresh access token” during token refresh in Google API.
  • Cause: Security patches on Windows Server 2003 disrupted the OAuth2 authentication process.
  • Impact: Listener service could not authenticate, blocking data migration.

Troubleshooting Steps

  1. Preliminary Fix Attempts:
    • Regenerated refresh_token using OAuth2TokenGenerator.
    • Adjusted OAuth parameters (e.g., grant_type).
    • Disabled firewall and antivirus, increased disk space.
    • None resolved the issue.
  2. Isolation Tests:
    • Tested executable vs Windows Service → same error.
    • Unit tests on Google API DLL (Google.Api.Ads.dll) confirmed issue persisted.
  3. Environment Analysis:
    • Success on Windows Server 2008/2012.
    • Failure on Windows Server 2003.
    • Pattern linked to OS and security updates.

Solution

  • Created a ListenerBridge service to act as a bridge:
    • Steps:
      1. CRM data queued in MSMQ on Server 2003.
      2. ListenerBridge transfers data to MSMQ on Server 2008/2012.
      3. Original Listener on Server 2008/2012 processes data and communicates with Google API.
  • This bypassed the token refresh issue on Server 2003.
The AI workspace that works for you. | Notion
A tool that connects everyday work into one space. It gives you and your teams AI tools—search, writing, note-taking—inside an all-in-one, flexible workspace.

Resolving a refresh token issue with Google API (Knowledge Base)