What's the correct way to migrate custom modules from a DEV account to my production account?

Currently I have developed the custom modules of my website using a Developer Sandbox Account, which allowed me to use a local development + the Hubspot CLI package

@hubspot/cli

Everything worked well.

However in order to move my modules from the sandbox account to the main account (which holds my live website) I need to right click on the modules and select this option here which shows my “main account”

NLima1_0-1696627240951.png

The first time I did this it all worked, as my modules were all new.

But now we have made a full redesign which I reused some of these modules and changed some of their structure.

when I try to do the same process to copy to a different account, it throws an error (which I assume it’s because the module already exists in the other account).

What is the ideal way of doing this process?

Also, once I have my modules transferred to the other account, how do I not mess with the current live website until I build the new pages and publish then?

Thanks in advance

Hi! the ideal approach for transferring your work from a development environment to a production environment in HubSpot is to “target your theme.” This involves taking your theme, transferring it to your development environment, making the necessary modifications, and then, using the same name, uploading and replacing the live theme with the enhanced version. This method ensures that both the development and production environments share the same foundation, allowing for seamless operation in both settings.

For more in-depth insights and guidance on this process, you can refer to the following page, which provides valuable information:

HubSpot CMS Local Development CLI Documentation

If you have any further questions or need additional assistance, please feel free to ask.