How do I migrate data and fix CLI authentication issues in HubSpot?

Hi team,
Please address the following issues:

Part 1: Data Migration Query (Internal/Reframed)
Subject: Process for migrating HubSpot configuration and data between Developer Accounts

We currently have two HubSpot developer accounts: one Free and one Paid.

Our automation suite currently runs daily against a test account nested under the Free developer account. However, we are facing the 90-day enterprise expiry limitation on these test accounts, even when they are generated from a paid developer tier.

Questions:

What are the recommended steps to migrate our standard and custom object definitions, along with their associated record data, from the Free account to the Paid account?

What is the most efficient way to transfer these custom objects and data specifically into a new test account under the Paid developer portal?

Part 2: HubSpot Support Ticket (Reframed & Polished)
Subject: HubSpot CLI Authentication Failure and Project Creation Issues for OAuth App

We are currently attempting to build a public OAuth app using the HubSpot Developer platform and the HubSpot CLI. Our ultimate goal is to configure a pure 3-legged OAuth flow with specific CRM scopes, utilizing the app’s client_id and client_secret within our external integration platform.

We are closely following the standard project creation flow documented in your guide:

npm install -g @hubspot/cli (Successfully installed version 8.9.1)

hs account auth

hs project create

The Issue
Although the browser login flow completes successfully during hs account auth, the CLI fails to register the authentication.

Running hs account list returns the following error:

Bash
[ERROR] Your HubSpot config file is invalid. Please fix the following errors:

  • No accounts found
    Checking the local configuration file (C:\Users\\.hscli\config.yml) reveals that the accounts array remains empty:

YAML
accounts: []
Because the CLI cannot find an authenticated account, our project creation command fails immediately:

Bash
hs project create --name hubspot-oauth-app --project-base app --distribution private --auth oauth

Error: No accounts found

Questions for Clarification
To help us bypass this blocker and ensure we are architecting this correctly, could you please clarify the following:

CLI Authentication: Does hs account auth now require a Personal Access Key for developer/paid portals instead of just the standard browser-based login?

App Creation Workflow: Should a public/OAuth app project be created locally and uploaded via hs project upload from a main Developer Account, or should the app itself be created via the UI first?

App Deployment: Once a project is uploaded, should the resulting app be installed into a developer test account or a standard customer account for testing?

Minimal Configuration: For a pure OAuth integration that does not utilize HubSpot UI elements (cards, functions, webhooks, etc.), is a minimal private OAuth app project structure sufficient?

Credentials Retrieval: Where exactly do we retrieve the generated client_id and client_secret after creating or uploading the project via the CLI?

Conclusion
We are currently blocked because the CLI config file is not updating after a successful browser login. Please advise on how to resolve this authentication issue and confirm the recommended workflow for setting up a new OAuth app via the CLI.

Hi @ShubhangiPawar, I hope that you are well!

Thanks for sharing your detailed questions with the HubSpot Community!

I’d like to share these resources that can help:

Now, let’s consult our Top Experts: Hi @Anton, @SteveHTM and @nickdeckerdevs1 do you have any insights to share with @ShubhangiPawar, please?

@ShubhangiPawar, I see that you’re also investigating this with our Support team, it’d be great if you could share your findings with the Community in case anybody else is having similar questions.

That said, let us know if you need further details or run into other roadblocks, we’re here to help!

Thanks and have a lovely day!
Bérangère

For future community posts @ShubhangiPawar, I’d suggest creating separate posts for each topic. This keeps things organized and makes it easier for the Community to provide you with the best support.

Hey @ShubhangiPawar,

quick info about the test/free dev accounts:

Yes, they got a 90 day trial period

You can reset this trial at any time and as often as you like from the “Parent account” (where this dev account was created through). Just click on Actions in the same row as the Test account. You should see the “Renew trial” option. This will reset the timer to 90-days

Fir a hassle-free dev experience, I’d recommend to set yourself a reminder or so which will notify you every 85 days or so.

If it’s a free developer account, the only way to sync things between free and paid accounts is via API (you could technically build an app for keeping them synced).

Note: The free accounts are for developer purposes only. Not for keeping real data in it.

Custom objects need to be moved either via API or be recreated in the portal itself, but again - real data shouldn’t be merged into the free account.

For the auth topic:
I’ve encountered this issue with Windows machines many times. Windows is just a pain in the back to work via CLI.

Does your user account got a “space” like
C:\Users\Anton B\.hscli\config.yml
in it?
If so, Windows doesn’t like this. Spend countless hours in debugging this and haven’t found a solution till this day - besides creating a new user/renaming the current one

Best,
Anton

I would split this into three separate tracks, because they are easy to mix together.

For the CLI issue: yes, current HubSpot CLI auth is based on a Personal Access Key. @hubspot/cli 8.9.1 is current, so if hs account auth completes but ~/.hscli/config.yml still has accounts: [], I would check file permissions / antivirus / OneDrive-controlled folders first, then run auth from a normal terminal as the same Windows user. The key must come from the target HubSpot account and the user needs developer/project permissions.

For the OAuth app: create/upload the project from the developer account, then manage the app under Development > Projects. The client ID/secret live in the app authentication settings after the app exists. You do not get a reusable access token for a 3-legged OAuth app; your integration gets tokens only after an install/authorization flow.

For migration: move schema first, then data. Export or recreate custom object schemas/properties/associations, deploy the app/project config, then migrate records with stable external IDs so reruns are idempotent. I would not treat test-account expiry as a production data store; keep seeded fixtures or a migration script that can rebuild the test account when needed.

Hi @ShubhangiPawar, to add to what @Anton and @danielsinewe shared (thank you!), here are the answers to your questions:

Regarding migrating custom objects & data between developer accounts, the recommended API-based approach is:

Schema migration:

  • Use hs custom-object fetch-all (CLI) or GET /crm-object-schemas/v3/schemas to export all custom object schemas from the source account.
  • Recreate those schemas in the target account using POST /crm-object-schemas/v3/schemas.

Record data migration:

  • Export records from the source account via the CRM Objects API.
  • Re-import them into the target account using the CRM Imports API (POST /crm/v3/imports).

On the 90-day expiry: Developer test accounts expire after 90 days if no API calls are made. You can prevent expiry by making API calls to the account, or manually renewing it from the Test Accounts page. Renewals via API must use an OAuth token from an app in the same developer account as the test account, and can only be done within 30 days of expiry.

As for the CLI authentication & oauth app setup:

For the CLI Auth Issue:
hs account auth requires a Personal Access Key, it is not a pure browser login. The browser opens so you can generate the key in HubSpot, but you must then copy and paste the key back into the terminal. If that step was skipped or the terminal prompt was missed, the config.yml will remain empty.

To fix it, you can run hs account auth again, follow the prompts to generate a Personal Access Key at HubSpot Login and Sign in , then paste the key into the terminal when prompted. The key will then be written to ~/.hscli/config.yml.

Now, to answer your specific questions:

CLI Auth: Yes, hs account auth requires a Personal Access Key, not just browser login. The browser is used to generate the key, which you then paste into the terminal.

App Creation Workflow: You can create the project locally via hs project create, then upload it to your developer account with hs project upload. There is no need to create the app in the UI first.

App Deployment/Testing: You can install the app in a developer test account first for testing, then in standard customer accounts for production.

Minimal OAuth project: Yes, for a pure OAuth integration with no UI extensions, a minimal app project with, auth oauth and only the required CRM scopes in app-hsmeta.json is sufficient.

Retrieving client_id / client_secret: After running hs project upload, run hs project open to open the project in HubSpot. Under Project Components, click your app name → Auth tab → Client credentials.

I hope this helps!
Bérangère

This post was created with the assistance of AI tools