In other words, I'm using version control with a staging area for my site.
As a result I have 2 accounts, we'll call them "production" and "developer" accounts. I use the developer account to build out site templates and test them before merging them to production.
The problem:
Unfortunately, I've run into a hitch with HubDB when working with a hubspot developer account. I want to use that developer account as a staging area to test my site, but I need to use the HubDB tables from my production account, since those are being managed by our marketing team.
But I can only specify the ID of the table from my developer account since that's where my hubspot.config.yml is pointing to, and I don't want to test by switching my hs watch to my production environment, for obvious reasons.
Is there a way to specify which account to use when pulling down a table using:
The best solution I've come up with so far is to replicate the table and columns from the production tables to the dev tables, then export the CSV of the data from the production tables and import/replace the rows in the dev tables. Not fun, but works when just testing a few items.
yeah - the way you've found is the only one which is "bulletproof".
I could think of something with the HubDB APIs. (just theoretical thoughts)
You would need to write a code which would sync the "update a row" API.
So basicly "if row X in HubDB Y(the live environment) is updated, take this informations and pass them to the API to update row Z in HubDB W(dev environment)". But I think this is extremly overengineered compared to the "export/import a CSV way".
The best solution I've come up with so far is to replicate the table and columns from the production tables to the dev tables, then export the CSV of the data from the production tables and import/replace the rows in the dev tables. Not fun, but works when just testing a few items.
Thanks for adding your workaround. If you are feeling crazy you could build this out with the HubDB api, but that might be overkill in terms of effort.
Honestly, I have no idea, but I'd love to know if you do come up with a solution for this.
I think generally Hubspot need to do a bit more work on the development workflow to allow for devs to do version control and have a staging environment for testing in the same account as "production" (i.e. not have to use two separate accounts) so we can access all the files, templates, modules, DBs etc that we need. There is Content Staging but that's only staging for new content, if you want to make changes to a module that is being used live there's no staging environment for that.