The Drupal to HubSpot Migration

If you are migrating a blog from Drupal to HubSpot, so you are in the right place...

Before migration, let's first know its background...

There is no doubt that over 86,000+ companies in more than 120 countries prefer to use HubSpot tools to grow their business and increase the number of leads. But, some say that it is not for everyone because some people are unaware of the device and some are still surprised to learn- is this the right solution for them?

HubSpot- All in One Business Automation is the best tool to date as it provides free CRM services, but it is also true that with the increase in the number of contacts, organizations will have to spend a few bucks out of their own pocket.

It is easy to migrate blogs from HubSpot to any other CRM and from other CRM to HubSpot but we had a lot of problems to bring blog from Drupal to HubSpot. And there is no specific way to migrate the blogs from Drupal to HubSpot.

I know you might be thinking that using traditional approaches (COPY and PASTE), one can easily transfer blogs directly from Drupal to HubSpot. There is no doubt that it is easy, but chances are you may lose data and have to spend time transferring each blog individually as there are 350+ blogs here.

Now, you might be thinking about the right way to move a blog from Drupal to HubSpot. Scrolling down and reading this article will guide you with the proper steps, considering which you can move Drupal Blogs to HubSpot.

Before moving Drupal to HubSpot migration, have you ever thought about what you need? let's take a look. If not, then see below.

What do we need to migrate?

Below are some fields that we had to migrate from Drupal to HubSpot.

  1. Blog Title
  2. Featured image of respective blog you want to migrate
  3. Blog Content (data, images, links, CTA, embed assets)
  4. Meta Description
  5. Publish time and date
  6. Author
  7. Tags/Categories

Now, without taking a minute, let's dive into the following steps allowing you to transfer your blog posts directly from Drupal to HubSpot.

Blog Migration Steps From Drupal to HubSpot

Let’s get started….

Step 1: Export data from Drupal

First of all, we have to export the content from Drupal as an xml file. The Views Data Export module can do the heavy lifting for you. You can see here how it is created.

The biggest challenge was to convert the XML file generated by views data export to the Wordpress XML format supported by Hubspot.

Here are the fields that we need to migrate from Drupal to Hubspot:

  • Title
  • Featured image
  • Categories
  • Author
  • Body
  • Teaser (excerpt)
  • Published date

Step 2: Wordpress XML

The next step would be to create the WordpressXML from the XML generated from Drupal. We have used a simple Python script to do the conversion. The BeautifulSoup library can be used to parse the XML and do the conversion. 

In its simplest form, the wordpress XML looks like

<?xml version="1.0" encoding="UTF-8"?> <!-- Meta information --> <rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:excerpt="http://wordpress.org/export/1.2/excerpt/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:wp="http://wordpress.org/export/1.2/" version="2.0"> <channel> <title>{title}</title> <link>{page_url}</link> <description>{page_description}</description> <pubDate>{time}</pubDate> <language>{lang}</language> <wp:wxr_version>1.2</wp:wxr_version> <wp:base_site_url>{page_url}</wp:base_site_url> <wp:base_blog_url>{page_url}</wp:base_blog_url> <!-- Authors, the same name should be used in the POSTs section --> <wp:author> <wp:author_login><![CDATA[{author1}]]></wp:author_login> <wp:author_display_name><![CDATA[{author1_name}]]></wp:author_display_name> </wp:author> <!-- Attachments: All featured images should come here as a separate item --> <generator>wp_feed_import.py</generator> <item> <title>{filename}</title> <link>{filename}</link> <pubDate>{date_rfc822}</pubDate> <dc:creator><![CDATA[{author}]]></dc:creator> <guid isPermaLink="false">{attachment_id}</guid> <wp:post_id>{post_id}</wp:post_id> <wp:post_date><![CDATA[{date}]]></wp:post_date> <wp:post_date_gmt><![CDATA[{date}]]></wp:post_date_gmt> <wp:post_name><![CDATA[{filename}]]></wp:post_name> <wp:status><![CDATA[inherit]]></wp:status> <wp:post_type><![CDATA[attachment]]></wp:post_type> <wp:attachment_url><![CDATA[{url}]]></wp:attachment_url> <wp:postmeta> <wp:meta_key><![CDATA[_wp_attached_file]]></wp:meta_key> <wp:meta_value><![CDATA[{filename}]]></wp:meta_value> </wp:postmeta> <wp:postmeta> <wp:meta_key><![CDATA[_wp_attachment_image_alt]]></wp:meta_key> <wp:meta_value><![CDATA[{filename}]]></wp:meta_value> </wp:postmeta> </item> <!-- All posts should come here --> <item> <title><![CDATA[{title}]]></title> <link>{link}</link> <pubDate>{date_rfc822}</pubDate> <dc:creator><![CDATA[{creator}]]></dc:creator> <guid isPermaLink="{guid_is_link}">{guid}</guid> <description /> <content:encoded><![CDATA[{content}]]></content:encoded> <excerpt:encoded><![CDATA[{excerpt}]]></excerpt:encoded> <wp:post_id>{post_id}</wp:post_id> <wp:post_date><![CDATA[{date}]]></wp:post_date> <wp:post_date_gmt><![CDATA[{date}]]></wp:post_date_gmt> <wp:post_name><![CDATA[{slug}]]></wp:post_name> <wp:status><![CDATA[publish]]></wp:status> <wp:post_type><![CDATA[post]]></wp:post_type> <!-- any number of categories can added with the category tag --> <category domain="category" nicename="{category_nicename1}"><![CDATA[{category_name1}]]></category> <wp:postmeta> <wp:meta_key><![CDATA[_thumbnail_id]]></wp:meta_key> <!-- The attachment_id should match the id in the attachments section --> <wp:meta_value><![CDATA[{attachment_id}]]></wp:meta_value> </wp:postmeta> </item> </channel> </rss>


You need to fill the placeholders with actual value from the xml generated from Drupal. You can see an example here, which uses the rss feed xml as input. We are not using rss xml as it has some limitations on featured image, categories etc..

Step 3: Importing the WordpressXML to HubSpot

After you've exported your WordPress posts, sign in to your HubSpot account.

  • In your HubSpot account, click the settings icon settings in the main navigation bar.
  • In the sidebar menu, navigate to CMS > Blog.
  • In the upper right, click Import blog.
  • In the blog import dashboard, click Import new blog.
  • Select Import XML file to upload your XML file of WordPress posts.


Conclusion

To summarise everything, to do a Drupal to Hubspot migration, the steps involved:

  • Export data from Drupal
  • Convert it to WordpressXML
  • Import XML to Hubspot

Hope you can do this migration with the help of this article. You can contact us here for more information.

‍And If you would like to know more about the HubSpot related migration, please look up the links below.

  1. The HubSpot Migration Checklist
  2. How to migrate your blog from HubSpot to WordPress

Similar Posts

Recent Posts

Mu Sigma logo

G2 Crowd | HubSpot Reviews

★★★★★ 4.6/5
5,997 reviews
Mu Sigma logo

capterra | HubSpot Reviews

★★★★★ 4.5/5
‎4,091 reviews