dev-libre-is/docs/_source/hubspot-migration.rst
2024-09-19 10:44:48 -06:00

217 lines
5.4 KiB
ReStructuredText

=================
Hubspot Migration
=================
HOWTO migrate data from Hubspot.
Hubspot Export
==============
Documentation on migrating from Hubspot to CiviCRM.
Data to migrate:
* Contacts.
Contacts Export
---------------
Hubspot can export contacts in these formats, all of which should
export identical data.
* CSV.
* XLS.
* XLSX.
Go to CRM --> Contacts and click the "Export" button on the right side.
For "Customize" export, it has options:
* Include all email addresses.
* Properties options.
* Associations.
Use these options for the most complete export:
* Include all email addresses: Checked.
* All properties and all associations on records: Selected.
* Include all associated record in each association column: Selected.
Click "Export" and it will present a link to an "Import and Export" page,
where it will show the progress of the export.
It will take approximately 1 minute per 1,000 records to export.
The unzipped export will be approximately 2.5 megs per 1,000 records.
The export will have over 500 columns.
Companies Export
----------------
Companies can be exported.
Go to CRM --> Companies and click the "Export" button on the right side.
Use these options for the most complete export:
* File format: CSV
* Include all company domains: Checked.
* All properties and associations on records: Selected.
* Include all association records in each association column.
Deals Export
------------
Go to CRM --> Deals and click the "Export" button on the right side.
* File format: CSV
* Include all company domains: Checked.
* All properties and associations on records: Selected.
* Include all association records in each association column.
Tickets Export
--------------
Go to CRM --> Tickets and click the "Export" button on the right side.
Lists Export
------------
Various mailing lists.
Go to CRM --> Lists and click the "Actions" button on the right side, then
select "Export".
* Name: All lists.
* Format: CSV.
* Choose what you'd like to export: All available list dashboard data.
Inbox Export
------------
HOWTO export?
Calls Export
------------
Go to CRM --> Calls and click the "Export" button on the right side.
* File format: CSV.
* Language of column headers: English.
* All properties and associations on records: Selected.
* Include all association records in each association column.
Tasks Export
------------
Uncheck "Assignee" to view all tasks.
HOWTO export?
Marketing Email
---------------
Go to Marketing --> Email and click the "Export emails" button on the right side.
* Export: Dashboard Emails.
* File Format: CSV.
* Send to: Email address of logged in Hubspot user.
* Columns: All available columns.
* Date: All time.
* Advanced options, Include advanced delivery data: checked.
Note, this export will not appear in the "Import and Export" page, unlike
most other exports.
Marketing Forms
---------------
Go to Marketing --> Forms and click the "Actions" button on the right side, then
select "Export forms".
* Name: All forms.
* Format: CSV.
* Send to: Email address of logged in Hubspot user.
* Choose what you'd like to export: All available form dashboard data.
Marketing CTAs (legacy)
-----------------------
Go to Marketing --> CTAs (legacy) and click "Export Data".
* File format: CSV.
* Send to: Email address of logged in Hubspot user.
Note, this export will not appear in the "Import and Export" page, unlike
most other exports.
Commerce Products
-----------------
Go to Commerce --> Products and click on the "Export" button.
* File format: CSV.
* Language of column headers: English.
* All properties and all associations on records: Selected.
* Include all associated record in each association column: Selected.
Automations Workflows
---------------------
Go to Automations --> Workflows, click the "Actions" button, then
"Export workflows".
* Name: All workflows.
* Format: CSV.
* Send to: Email address of logged in Hubspot user.
* Choose what you'd like to export: All available workflow dashboard data.
Activities Export
-----------------
Activities appear to be emails and such sent to contacts.
These are not in the contacts export.
Hubspot API
===========
Some data in Hubspot cannot be exported, it needs to be retrieved via the API.
API reference:
`<https://developers.hubspot.com/beta-docs/reference/api>`_
API guide:
`<https://developers.hubspot.com/beta-docs/guides/api>`_
Per Hubspot docs:
"Activities on records, such as notes or emails, cannot be exported.
To retrieve activities, you can export certain activity reports
or use the engagements API."
`<https://developers.hubspot.com/beta-docs/guides/api/crm/engagements/engagement-details>`_
Python code for API:
`<https://github.com/HubSpot/hubspot-api-python>`_
`<https://pypi.org/project/hubspot-api-client/>`_
Hubspot Python Client
---------------------
The best way to use the Hubspot API appears to be to
set up a read-only "Private App".
Set up a Python client thusly:
.. code-block:: sh
sudo apt install python3-venv python3-pip python-is-python3
mkdir hubspot-client
cd hubspot-client/
python -m venv venv
source venv/bin/activate
pip install -U setuptools pip wheel
pip install hubspot-api-client
Extract Clients
---------------
Create a hubspot-extract-clients.py script:
.. code-block:: sh
#!/usr/bin/env python
from hubspot import HubSpot
api_client = HubSpot()
api_client.access_token = 'access_token'
all_contacts = api_client.crm.contacts.get_all()