Migrating HubSpot Templates Using KingswaySoft HubSpot Toolkit

06 November 2024
KingswaySoft Team

HubSpot CMS is a powerful system for companies to manage both their website and content strategy. One of the most crucial aspects of HubSpot CMS is its use of Templates. Templates are files that define the layout of your HubSpot pages, emails, and themes. They are often the first thing selected when HubsSpot users create a new page or email. Due to their importance within HubSpot CMS, our SSIS Integration Toolkit for HubSpot has provided support for working specifically with Templates and their migration.

In this blog post, we will review two different scenarios for working with HubSpot Templates. The first scenario is transferring templates stored in your local machine to your HubSpot instance. This allows developers to develop their templates locally and then migrate them onto HubSpot afterward. The second scenario is migrating HubSpot templates from one HubSpot instance to another. A possible situation would be if you had a "master" template, but at the same time, you would need specific template changes for each department. In this case, we would want to push this "master" template(s) downstream from the main HubSpot instance to the other departments (with their own HubSpot instances) where they can make further changes.

Scenario 1: Migrating Templates from Local Folders to HubSpot

Migrating From Local File System.png

In this case, you can utilize a Premium File System Source component (available within our SSIS Productivity Pack) to read the template files and connect to the HubSpot Destination component, to then write to your HubSpot instance while performing some minor transformations (using a Premium Derived Column component, which will also allow you to provide any additional metadata needed for HubSpot).

FileSystemSource.png

The Premium File System Source component can be used to read from the New folder, which contains all the files we have on our local machine. Set the Advanced filter to pick up the template files based on any criteria depending on the file names present.

We would then use a Premium Derived Column component to create the additional columns needed for the HubSpot Destination.

Derived Column Migrate From Locale.png

In the NewSource column, we will use the function below to read the actual content from the file.

ReadTextContent( [__PremiumFilePack.FullPath] )

Next, we will need to specify the path where the file will be written in HubSpot. For this, we create a derived column called NewPath and concatenate the folder path with the file name.

"MigratedFolder/"  + [__PremiumFilePack.Name]

The final derived column will be the Template Type, which is a numeric value that will set the type of template that is being created. Entering an invalid value or leaving it blank will set the template type to None. Below are the Template Types to choose from:

  • 2 - Email template
  • 4 - Page template
  • 11 - Error template
  • 12 - Subscription preferences template
  • 13 - Backup unsubscribe page template
  • 14 - Subscriptions update confirmation template
  • 19 - Password prompt page template
  • 27 - Search results template
  • 29 - Membership login template
  • 30 - Membership registration template
  • 31 - Membership reset password confirmation template
  • 32 - Membership reset password request template

Another optional field is the is_available_for_new_content field, which should be set to either True or False. By default, this field is set to False.

Now, in the HubSpot Destination component, you can choose the Destination Object as Template and set the action as Create.

HubspotDestination.png

Then, go to the Columns page, where you will map these columns to their respective fields.

HubspotDestination Mappings.png

With the above data flow configuration, you can easily migrate or create HubSpot templates from your local file system upon execution. You can see how simple the process is.

Alternatively, another solution for reading the templates involves using a flat file or Excel file that contains a table listing the template's source file path, template name, and new destination path. For example, if your templates are all listed in different folders, but you have a table listed where all the templates are, you could use this to create the necessary columns that are pushed to the Hubspot destination component.

ExcelTemplate.png

In this example, it's in an Excel file, so you can use a Premium Excel Source component. However, you can use any Source component depending on the data source. With this method, you can read files from different folders, and with the IfElse function in the Premium Derived Column component, you can easily convert the Template Type to the value needed.

Scenario 2: Migrating Templates from HubSpot to HubSpot

In this case, you will need a HubSpot Source and HubSpot Destination component connected to 2 different HubSpot Connection Managers, each connecting to a different HubSpot instance. In between the Source and the Destination components, you will include a Premium Derived Column component, which will be used to provide additional columns required for the transformation.

Hubspot_to_Hubspot.png

The Source component will be used to read the template. In the component, set the Source object as Template.

HubspotSource.png

With our Source component, you can further filter to read specific templates by using the Filter Parameters. This way, you have greater control over which templates you wish to migrate. For example, if you want to migrate a "master" template to other HubSpot instances, you may set the is_availabe_for_new_content value to True. By using filters, templates migrated can be further edited and tailored for different situations. In the Premium Derived Column component, you can set up the new path to which you are writing. You will need to set this as the path from your Destination HubSpot instance, as this may be different from the Source, and may not transfer properly without the path.

Derived Column New Path.png

Finally, you will map the Premium Derived Column component to the HubSpot Destination component that is connected to the second HubSpot instance. The steps are similar to the first scenario, where you create the templates with the Template chosen as the Destination Object. In the columns tab, you can map the fields you are getting from your Source component to the Destination.

Conclusion 

In this blog post, we have gone over HubSpot Templates in SSIS and the different scenarios for migrating HubSpot templates, whether from a local environment to HubSpot, or from HubSpot to HubSpot. This approach simplifies the design complexity for migration cases, allowing you to handle and process templates with greater flexibility and efficiency.

We hope this has helped! 

 About 

Archive

November 2024 3 October 2024 1 September 2024 1 August 2024 2 July 2024 1 June 2024 1 May 2024 1 April 2024 2 March 2024 2 February 2024 2 January 2024 2 December 2023 1 November 2023 1 October 2023 2 August 2023 1 July 2023 2 June 2023 1 May 2023 2 April 2023 1 March 2023 1 February 2023 1 January 2023 2 December 2022 1 November 2022 2 October 2022 2 September 2022 2 August 2022 2 July 2022 3 June 2022 2 May 2022 2 April 2022 3 March 2022 2 February 2022 1 January 2022 2 December 2021 1 October 2021 1 September 2021 2 August 2021 2 July 2021 2 June 2021 1 May 2021 1 April 2021 2 March 2021 2 February 2021 2 January 2021 2 December 2020 2 November 2020 4 October 2020 1 September 2020 3 August 2020 2 July 2020 1 June 2020 2 May 2020 1 April 2020 1 March 2020 1 February 2020 1 January 2020 1 December 2019 1 November 2019 1 October 2019 1 May 2019 1 February 2019 1 December 2018 2 November 2018 1 October 2018 4 September 2018 1 August 2018 1 July 2018 1 June 2018 3 April 2018 3 March 2018 3 February 2018 3 January 2018 2 December 2017 1 April 2017 1 March 2017 7 December 2016 1 November 2016 2 October 2016 1 September 2016 4 August 2016 1 June 2016 1 May 2016 3 April 2016 1 August 2015 1 April 2015 10 August 2014 1 July 2014 1 June 2014 2 May 2014 2 February 2014 1 January 2014 2 October 2013 1 September 2013 2 August 2013 2 June 2013 5 May 2013 2 March 2013 1 February 2013 1 January 2013 1 December 2012 2 November 2012 2 September 2012 2 July 2012 1 May 2012 3 April 2012 2 March 2012 2 January 2012 1

Tags