Best way to populate a development sandbox account with data



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?


Hey @Adam,

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



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.


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


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

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


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


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



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.



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



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.


@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.



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: