APIs & Integrations

Not applicable

Best way to populate a development sandbox account with data

Hi,

The project I’m working on makes extensive use of the HubSpot APIs, and I want to be able to test it with a data set more robust than the “demo” data you guys provide. To that end, I want to setup a development sandbox account populated with data that can be returned when I make various API calls. I’ve got a HubSpot customer willing to export their data for me, but I’m not sure what the best way to import their data to my sandbox is. Looking over the HubSpot Academy documentation, I see that I can import Contacts and a Wordpress Blog using the HubSpot GUI. Is there any other support for imports through the GUI? Or will I have to use the API endpoints / manual insertion through the GUI to get my sandbox setup?

12 Replies 12
RKatz
Participant

Best way to populate a development sandbox account with data

Hi All, 

 

I was frustrated by the lack of a scalable solution here, so I wrote an open source Python utility to migrate data from a Hubspot Production Instance to a Hubspot Sandbox Instance using only your Production and Sandbox API Keys.

 

You can find it here: https://github.com/CorrDyn/hubspot-prod-to-sandbox

If you like this tool, shoot me an email at ross.katz@corrdyn.com to let me know how you're using it or how it can be better. Or just connect with me on LinkedIn to discuss.

 

I hope this saves you as much time as it will save me!

Ross

0 Upvotes
Not applicable

Best way to populate a development sandbox account with data

@seb_fairchild Is there any way to export the demo data?

0 Upvotes
seb_fairchild
Member

Best way to populate a development sandbox account with data

@Adam What do you mean by export the demo data?

0 Upvotes
Not applicable

Best way to populate a development sandbox account with data

@seb_fairchild

I mean export the data I get back when I use the ‘hapikey=demo’ access token. If it was possible to get all the contacts associated with the demo account as a CSV for example, I could use the built-in contacts import tool to get the data into my sandbox.

0 Upvotes
seb_fairchild
Member

Best way to populate a development sandbox account with data

@Adam similar to my response to James above, you can pretty much just use the response from the get all contacts endpoint as the payload to create contacts in your demo portal.

You’ll either need to write a script to extract the properties you want to keep, or you can use a JSON to CSV converter to convert the response into a CSV if that’s easier to edit.

Sebastian

0 Upvotes
Not applicable

Best way to populate a development sandbox account with data

In this regard, I really miss a ‘delete all’ API command for contacts, companies and deals. I know, in a live environment this will only do harm, but in order to set up automated tests it would really come in handy.

I can also not find the csv import possibility via API. So I go for a script that prepares data in json and put them into the test portal.

Probably there will be no way to get the test run to less than 30 secs per test, but hey, I can have automated tests for my intergration :smiley:

0 Upvotes
Not applicable

Best way to populate a development sandbox account with data

This really seems like a request that makes sense to accommodate. Having to write a script to import all the settings into a sandbox seems like overkill and should be included out of the box.

seb_fairchild
Member

Best way to populate a development sandbox account with data

Hey @Adam,

The only two methods of importing objects is via API, or UI with a csv.

Sebastian

0 Upvotes
Not applicable

Best way to populate a development sandbox account with data

Is it possible to important anything other than Contacts via CSV?

0 Upvotes
seb_fairchild
Member

Best way to populate a development sandbox account with data

@Adam you can import Contacts, Companies, and Deals via CSV.

How to import a spreadsheet of contacts into your account

Learn how to import a list of leads and contacts into your account to begin building up your HubSpot contact database.



@James_Bathgate can you be more specific about the settings that you want to import?

0 Upvotes
Not applicable

Best way to populate a development sandbox account with data

@seb_fairchild The two off the top of my head are custom properties and pipelines.

0 Upvotes
seb_fairchild
Member

Best way to populate a development sandbox account with data

@James_Bathgate,

You can pretty much just request all custom properties from your current portal then POST the response to the test portal. You’ll just want to filter out any properties that have the hubspotDefined flag set to true. Note that custom properties don’t have a HubSpotDefined param.

It is possible to create new Deal pipelines by posting to deals/v1/pipelines. I’m going to have that added to the Developers docs.

Sebastian