CMS Development

FabianRichter
Contributor

Copy HubDB tables with foreign IDs between portals

SOLVE

Hi everyone,

I am working on a development workflow for our website and I already learned a lot about working with the HubSpot CLI and using Git with it. The workflow is based on two portals, the live portal and the sandbox portal. I never touch the files in the design manager on the live portal directly but I work with a cloned version in my sandbox account. Whenever I work on the CMS, I do it in the sandbox portal, using the local environment. Once I finished something, I push it to my Git repository. When I merge my changes into the main branch, it automatically gets deployed to the live portal. So far so good.

For some features I use the HubDB and that's great. Some of my tables use foreign IDs. When I fetch them by CLI and want to upload them to my sandbox portal, I get an error, because the sandbox portal does not know these foreign IDs. Is there any way of cloning them easily or accessing the same tables on both portals?

Thanks in advance,
Fabian Richter

0 Upvotes
1 Accepted solution
dbeau79
Solution
Contributor | Diamond Partner
Contributor | Diamond Partner

Copy HubDB tables with foreign IDs between portals

SOLVE

@FabianRichter , I've run into this issue but not in the automated way in which you are working between two portals.  I was downloading and the uploading (csv).  What I did was map the foreign id with a vlookup in my google sheet so when I uploaded it everything would be set correctly.  I know it seems it clunky but the only thing I can think of is if you "save as" your sandbox table json files and do a find/replace of the foreign ids so when you upload to production they match.  

 

cc @dennisedson 

View solution in original post

2 Replies 2
dbeau79
Solution
Contributor | Diamond Partner
Contributor | Diamond Partner

Copy HubDB tables with foreign IDs between portals

SOLVE

@FabianRichter , I've run into this issue but not in the automated way in which you are working between two portals.  I was downloading and the uploading (csv).  What I did was map the foreign id with a vlookup in my google sheet so when I uploaded it everything would be set correctly.  I know it seems it clunky but the only thing I can think of is if you "save as" your sandbox table json files and do a find/replace of the foreign ids so when you upload to production they match.  

 

cc @dennisedson 

dennisedson
HubSpot Product Team
HubSpot Product Team

Copy HubDB tables with foreign IDs between portals

SOLVE

@dbeau79 ,

Have you dealt with this before?

0 Upvotes