Data migration out of HS - File uploads (fields and forms also)

karien
Contributor | Gold Partner
Contributor | Gold Partner

How to get my files out of hubspot. Is the only option Via API, and how would i structure it so i know to which record the files belong to. 
But for now, at the very least can i just download all files to have a file dump of some sort

 

0 Upvotes
2 Accepted solutions
karien
Solution
Contributor | Gold Partner
Contributor | Gold Partner

I managed to have success with Files API, downloading with the File URL. thx

 

View solution in original post

0 Upvotes
RubenBurdin
Solution
Guide

Hi @karien 

that bulk export pain is very real, especially once you hit rate limits and start seeing private files fail.

For the “file dump,” the closest you get natively is scripting against the Files API search endpoint, paging through all files and then downloading via the file URL or signed URL for private ones (GET /files/v3/files/search + /files/v3/files/{fileId}/signed-url).

 

That lets you include both public and private files, filter by createdAt, and iterate until you’ve pulled everything (respecting the usage guidelines on rate limits and adding a small delay or retries in your script)

(https://developers.hubspot.com/docs/api-reference/files-files-v3/guide )

 

The harder part is associations. Most “attachments” in the CRM aren’t first-class file associations, they’re usually files linked via notes or form submissions. For notes, you can pull notes associated to contacts/deals and read hs_attachment_ids, then map those IDs back to files with the Files API

(https://developers.hubspot.com/docs/api-reference/crm-notes-v3/guide )

 

For form uploads, you typically have to combine form submission data with the Files API so you keep a file > submission > contact/deal chain. If you share which objects matter most in your migration, it’s easier to narrow which of those joins you actually need. If consistency between HubSpot and your finance or ops system is the gap, "Stacksync" keeps them mirrored as changes happen.

Did my answer help? Please mark it as a solution to help others find it too.

Ruben Burdin Ruben Burdin
HubSpot Advisor
Founder @ Stacksync
Real-Time Data Sync between any CRM and Database
Stacksync Banner

View solution in original post

8 Replies 8
RubenBurdin
Solution
Guide

Hi @karien 

that bulk export pain is very real, especially once you hit rate limits and start seeing private files fail.

For the “file dump,” the closest you get natively is scripting against the Files API search endpoint, paging through all files and then downloading via the file URL or signed URL for private ones (GET /files/v3/files/search + /files/v3/files/{fileId}/signed-url).

 

That lets you include both public and private files, filter by createdAt, and iterate until you’ve pulled everything (respecting the usage guidelines on rate limits and adding a small delay or retries in your script)

(https://developers.hubspot.com/docs/api-reference/files-files-v3/guide )

 

The harder part is associations. Most “attachments” in the CRM aren’t first-class file associations, they’re usually files linked via notes or form submissions. For notes, you can pull notes associated to contacts/deals and read hs_attachment_ids, then map those IDs back to files with the Files API

(https://developers.hubspot.com/docs/api-reference/crm-notes-v3/guide )

 

For form uploads, you typically have to combine form submission data with the Files API so you keep a file > submission > contact/deal chain. If you share which objects matter most in your migration, it’s easier to narrow which of those joins you actually need. If consistency between HubSpot and your finance or ops system is the gap, "Stacksync" keeps them mirrored as changes happen.

Did my answer help? Please mark it as a solution to help others find it too.

Ruben Burdin Ruben Burdin
HubSpot Advisor
Founder @ Stacksync
Real-Time Data Sync between any CRM and Database
Stacksync Banner
karien
Contributor | Gold Partner
Contributor | Gold Partner

thx Ruben for your time, i appreciate. my first concern is now just getting the file uploads, but you bring important points like attachments. so thank you for that. 

0 Upvotes
Jaycee_Lewis
Thought Leader

Hey, @karien 👋 Thanks for the question!  I see you can export of files in-app, but it doesn't seem to export with associations. Hey @GiantFocal @MichaelMa @zach_threadint have you done this using the Exports API? Thank you for taking a look!— Jaycee





loop


Loop Marketing is a new four-stage approach that combines AI efficiency and human authenticity to drive growth.

Learn More




0 Upvotes
karien
Contributor | Gold Partner
Contributor | Gold Partner

Hi, Jaycee, im referring to ALL files, ones uploaded via form fields also (these dont show up on the app, its apparently hidden. So im busy wih code to try get it via Files API

0 Upvotes
BérangèreL
Community Manager
Community Manager

Hi @karien and thanks for sharing these additional details!
 

Here are some helpful resources you might find useful:

- File API
- Get a file uploaded via form
- Exports

Let’s also check in with our wonderful experts: Hi @Mike_Eastwood, @RubenBurdin and @Gonzalo do you have any tips or suggestions to help @karien, please?

Thanks so much and wishing you a fantastic day!
Bérangère





loop


Loop Marketing is a new four-stage approach that combines AI efficiency and human authenticity to drive growth.

Learn More




0 Upvotes
karien
Solution
Contributor | Gold Partner
Contributor | Gold Partner

I managed to have success with Files API, downloading with the File URL. thx

 

0 Upvotes
BérangèreL
Community Manager
Community Manager

Awesome @karien, glad to hear the Files API worked for your migration!

Thanks for sharing your experience.

Have a lovely weekend and looking forward to seeing you around the Community! 🤗
Bérangère





loop


Loop Marketing is a new four-stage approach that combines AI efficiency and human authenticity to drive growth.

Learn More




0 Upvotes
karien
Contributor | Gold Partner
Contributor | Gold Partner

Thank you for the information, however, im trying to do a bulk export of all files on HS for migration purposes. And i struggle to find working API code. i hit rate limits and struggle with certain files -  private files. i also have to get the associatons records of these files

 

0 Upvotes