Exporting Salsa for CiviCRM » History » Version 50
Jon Goldberg, 10/28/2015 10:22 AM
1 | 24 | Jon Goldberg | {{lastupdated_at}} by {{lastupdated_by}} |
---|---|---|---|
2 | |||
3 | 1 | Jon Goldberg | h1. Exporting Salsa for CiviCRM |
4 | |||
5 | 50 | Jon Goldberg | h2. Before you begin |
6 | 1 | Jon Goldberg | |
7 | 50 | Jon Goldberg | * When exporting from Salsa, exporting to screen and exporting to a file yield different formats! Be sure to be consistent, or you'll find that your field names change, your date formats change, etc. *If you're exporting to give data to Palante, please use the scheduled export*. |
8 | * Salsa data is VERY messy compared to Civi data. Expect to find a lot of records that don't have a first name, last name OR e-mail address. Expect to find donations, participant records, etc. not attached to a supporter (most likely from a legacy import). Expect to find records with NULL for their "Date Created" values. Plan your transformations accordingly. |
||
9 | 1 | Jon Goldberg | |
10 | 50 | Jon Goldberg | h2. Exporting Supporter Data |
11 | |||
12 | When logged in as a Manager, go to "Supporter Management" tab, and "Query/Export" will give you a full export of contact data. There's a "Select My Entire List" button. There's also an "include my deleted supporters" checkbox, which you may want to check (but probably not). This will NOT get you groups/tags, but WILL get you the equivalent of @civicrm_contact@ plus all custom fields attached to the contact. |
||
13 | |||
14 | 25 | Jon Goldberg | h2. Exporting Data not on the Contact Entity |
15 | 1 | Jon Goldberg | |
16 | 8 | Jon Goldberg | You need to get to custom reports. If you have the Reports tab, great; if not, you can get there by clicking "Supporter Management" tab, then "Built-in Reports", then "Clone and Edit" a report, then select "List Your Custom Reports". Or go straight here: https://hq-org.salsalabs.com/dia/hq/reports/list.jsp?table=report |
17 | |||
18 | 11 | Jon Goldberg | h3. Groups |
19 | 12 | Jon Goldberg | |
20 | 3 | Jon Goldberg | * Create a new report. |
21 | * Select the type of report you would like to create: Standard report |
||
22 | * Use "Advanced Object Chooser". |
||
23 | 9 | Jon Goldberg | * Report "Supporter Groups", then "Groups". Press "Save". |
24 | 1 | Jon Goldberg | * Select the "Columns" tab and select your columns. I like just "Supporter Key" and "Group Name". |
25 | 7 | Jon Goldberg | * In Conditions, "Group Name" should be "Not Empty". |
26 | 4 | Jon Goldberg | * Save, Run the report. |
27 | * Click the "Export" link. |
||
28 | 1 | Jon Goldberg | |
29 | 11 | Jon Goldberg | h3. Tags |
30 | 12 | Jon Goldberg | |
31 | 5 | Jon Goldberg | * Create a new report. |
32 | * Select the type of report you would like to create: Standard report |
||
33 | * Use "Advanced Object Chooser". |
||
34 | * Report on "Tags", then "Tags Data", then "Database Table". Press "Save". |
||
35 | * Select the "Columns" tab and select your columns. I like just "Tag" and "Table Key". |
||
36 | 1 | Jon Goldberg | ** "Table Key" is the Supporter Key. It's similar to "entity_id" in CiviCRM. |
37 | 7 | Jon Goldberg | * In "Conditions", "Table Name" should equal "supporter". |
38 | 10 | Jon Goldberg | * Add another condition: "Tag.Tag" is "Not Empty". |
39 | 1 | Jon Goldberg | * Save, Run the report. |
40 | * Click the "Export" link. |
||
41 | |||
42 | 11 | Jon Goldberg | h3. Events |
43 | 1 | Jon Goldberg | |
44 | 15 | Jon Goldberg | As above, but no conditions, and report on the "Event" table. If you're only importing legacy events, this is a good list of easy fields to import: |
45 | Event KEY |
||
46 | Reference Name |
||
47 | Event Name |
||
48 | Description |
||
49 | Start |
||
50 | End |
||
51 | Deadline |
||
52 | Maximum Attendees |
||
53 | 46 | Jon Goldberg | Date Created (is a useful proxy when "Start" isn't defined) |
54 | 15 | Jon Goldberg | |
55 | 1 | Jon Goldberg | h3. Participants |
56 | 16 | Jon Goldberg | |
57 | As above. Report on tables "Supporter Event", then "Event". Note that there are a lot of tables that _look_ like "Supporter Event", like "Supporterevent" and "Supporter Events"! |
||
58 | |||
59 | Note that if you're matching on a unique field from "Events", you can just export "Supporter Event" and not the "Event" table. |
||
60 | Here are the fields I exported and what I matched them to: |
||
61 | Supporter KEY external_identifier |
||
62 | Event KEY event_key |
||
63 | Status status |
||
64 | Type role |
||
65 | Date Created register_date |
||
66 | |||
67 | 28 | Jon Goldberg | h3. Recurring Donations |
68 | |||
69 | Export on table "Recurring Donation". Here's the field mapping: |
||
70 | |||
71 | Recurring Donation Key -> trxn_id |
||
72 | Supporter Key -> external_identifier |
||
73 | Transaction date -> create_date |
||
74 | Start Date -> start_date |
||
75 | RPREF -> invoice_id |
||
76 | RESULT (exclude 37, they're tests) |
||
77 | Amount -> amount |
||
78 | Pay Period -> use to remap to frequency_unit and frequency_interval |
||
79 | TERM -> installments |
||
80 | Status(?) |
||
81 | |||
82 | Note that in Salsa, there's no clear-cut way to tell whether a contact's recurring donation is still working or not - "Status" isn't a complete indicator, and thus doesn't cleanly map into Civi. |
||
83 | |||
84 | 27 | Jon Goldberg | h3. Donations |
85 | |||
86 | It's important to link the recurring donations to the donations when exporting if you need to identify the first recurring donation (e.g. to generate thank-you letters if it's a first donation and recurring). |
||
87 | |||
88 | 30 | Jon Goldberg | Under "Conditions", filter by "Supporter KEY is not empty" - when Salsa imports legacy data into their system, sometimes they don't do such a hot job. |
89 | |||
90 | 29 | Jon Goldberg | Export on table "Donation" linked to table "Donate Page". You'll want these fields (more or less): |
91 | 27 | Jon Goldberg | |
92 | Donation.donation KEY(donation) |
||
93 | 1 | Jon Goldberg | Donation.supporter KEY(donation) |
94 | 42 | Jon Goldberg | donate_page.Reference_Name (contribution_page_id) |
95 | Donation.Date_Entered |
||
96 | 27 | Jon Goldberg | Donation.Transaction Date(donation) |
97 | 1 | Jon Goldberg | Donation.amount(donation) |
98 | 43 | Jon Goldberg | Donation.Transaction Type(donation) (financial_type) |
99 | Donation.RESULT(donation) (only 0 and -1 should be accepted, others are tests) |
||
100 | 42 | Jon Goldberg | Donation.Tracking Code(donation) (source) |
101 | Donation.Designation Code(donation) (source - not sure what the differentiation between designation and tracking codes is) |
||
102 | 1 | Jon Goldberg | Donation.In Honor Name(donation) |
103 | Donation.In Honor Email(donation) |
||
104 | 27 | Jon Goldberg | Donation.In Honor Address(donation) |
105 | Recurring donation.Transaction Date(recurring_donation) |
||
106 | 1 | Jon Goldberg | Donation.Order_Info |
107 | 42 | Jon Goldberg | Donation.Form of Payment (payment_instrument) |
108 | 27 | Jon Goldberg | |
109 | 44 | Jon Goldberg | *Special Note:* Salsa seems to keep donations that are tied to supporters that don't exist (that is, the supporter_key on the donation doesn't match anyone in Salsa). I've seen this multiple times; I don't know why this is, but this is normal. |
110 | |||
111 | 19 | Jon Goldberg | h3. Actions |
112 | 17 | Jon Goldberg | |
113 | 19 | Jon Goldberg | Salsa has a separate table for actions, making them structurally comparable to Civi Events. A good match in Civi is the Survey entity, which is used for petitions. |
114 | 1 | Jon Goldberg | |
115 | 19 | Jon Goldberg | Export as above. Report on table "Action". |
116 | 1 | Jon Goldberg | Condition: "Reference Name" is not empty. |
117 | 47 | Jon Goldberg | |
118 | Fields: |
||
119 | Action.action KEY |
||
120 | Action.Reference Name |
||
121 | Action.Date Created |
||
122 | Action.Signatures |
||
123 | Action.Last Modified |
||
124 | Action.Title |
||
125 | Action.Description |
||
126 | |||
127 | 19 | Jon Goldberg | |
128 | *Note*: "Description" is likely to contain HTML that breaks the export. I find it helpful to export it as the last column. |
||
129 | |||
130 | h3. Supporter_Actions |
||
131 | 11 | Jon Goldberg | |
132 | 22 | Jon Goldberg | Export "action" and "supporter_action" and "supporter_action_comment" in that order. |
133 | 23 | Jon Goldberg | Condition: supporter_key IS NOT NULL |
134 | 20 | Jon Goldberg | |
135 | Here's the fields I grabbed with their mapping: |
||
136 | 22 | Jon Goldberg | supporter_action.supporter_key |
137 | 21 | Jon Goldberg | action.Reference Name |
138 | 22 | Jon Goldberg | supporter_action.Date_Created |
139 | 48 | Jon Goldberg | supporter_action_comment.Comment |
140 | 20 | Jon Goldberg | |
141 | 31 | Jon Goldberg | h3. Letter to the Editor |
142 | |||
143 | This isn't a feature CiviCRM has, but it maps reasonably well to an activity when migrating. |
||
144 | * Create a new report. |
||
145 | * Select the type of report you would like to create: Standard report |
||
146 | * Use "Advanced Object Chooser". |
||
147 | 49 | Jon Goldberg | * Report "Supporter Letter", then "Letter". Press "Save". |
148 | 31 | Jon Goldberg | * Select the "Columns" tab and select your columns: |
149 | > Date_Created -> activity_date_time |
||
150 | > supporter_KEY -> external_identifier |
||
151 | > person_media_ID? -> seems important - but I can't find a matching table, and this data doesn't seem to be accessible from Salsa. |
||
152 | > Letter_Subject -> details (concatenated) |
||
153 | > Letter_Content -> details |
||
154 | > Reference_Name -> subject |
||
155 | * Save, Run the report. |
||
156 | * Click the "Export" link. |
||
157 | |||
158 | 11 | Jon Goldberg | h3. Chapters |
159 | 12 | Jon Goldberg | |
160 | 7 | Jon Goldberg | * Create a new report. |
161 | 1 | Jon Goldberg | * Select the type of report you would like to create: Standard report |
162 | 7 | Jon Goldberg | * Use "Advanced Object Chooser". |
163 | 8 | Jon Goldberg | * Report "Supporter Chapter", then "Chapter". Press "Save". |
164 | * Select the "Columns" tab and select your columns. I like just "Supporter KEY" and "Chapter.Name". |
||
165 | * In Conditions, "Chapter.Name" should be "Not Empty". |
||
166 | 5 | Jon Goldberg | * Save, Run the report. |
167 | 1 | Jon Goldberg | * Click the "Export" link. |
168 | |||
169 | 32 | Jon Goldberg | h2. Programmatically creating custom fields in CiviCRM |
170 | |||
171 | To do this, you'll need to create a custom group, custom fields, option groups, and option values. |
||
172 | |||
173 | h3. Custom Field Group |
||
174 | |||
175 | Don't export anything from Salsa - just create this manually, or using my Kettle transform. |
||
176 | |||
177 | h3. Custom Fields, Option Groups, Option Values |
||
178 | |||
179 | 33 | Jon Goldberg | _Custom Columns_ |
180 | * Create a new report. |
||
181 | * Select the type of report you would like to create: Standard report |
||
182 | * Use "Advanced Object Chooser". |
||
183 | * Report "Custom Columns". Press "Save". |
||
184 | * Select the "Columns" tab and select your columns: |
||
185 | 36 | Jon Goldberg | > custom_column_key -> needed to relate to custom_column_options. Store in filter temporarily. |
186 | 34 | Jon Goldberg | > data_table (should = supporter_custom. In theory, we can probably export non-contact custom fields in this same process) |
187 | 33 | Jon Goldberg | > Date_Created -> created_date |
188 | > label -> label |
||
189 | > type -> data_type, html_type (can be bool, enum, text, varchar) |
||
190 | > Description -> help_pre |
||
191 | > Order -> weight |
||
192 | 38 | Jon Goldberg | > Name |
193 | 33 | Jon Goldberg | * Save, Run the report. |
194 | 1 | Jon Goldberg | * Click the "Export" link. |
195 | 37 | Jon Goldberg | * Do NOT import the Salsa name, it'll screw up Civi. |
196 | 1 | Jon Goldberg | |
197 | 35 | Jon Goldberg | _Option Groups_ |
198 | 36 | Jon Goldberg | These will be created automatically when you create custom fields. |
199 | 35 | Jon Goldberg | |
200 | 1 | Jon Goldberg | _Custom Column Options_ |
201 | 33 | Jon Goldberg | * Create a new report. |
202 | * Select the type of report you would like to create: Standard report |
||
203 | * Use "Advanced Object Chooser". |
||
204 | * Report "Custom Column Options". Press "Save". |
||
205 | * Select the "Columns" tab and select your columns: |
||
206 | 1 | Jon Goldberg | > custom_column_KEY -> a lookup field (against civicrm_custom_field.filter to get option_group_id) |
207 | 37 | Jon Goldberg | > custom_column_option_KEY -> value |
208 | > value -> name |
||
209 | 33 | Jon Goldberg | > label -> label |
210 | > isDefault -> is_default |
||
211 | > isDisplayed -> is_active |
||
212 | > _Order -> weight |
||
213 | * Save, Run the report. |
||
214 | * Click the "Export" link. |
||
215 | 7 | Jon Goldberg | |
216 | 1 | Jon Goldberg | h3. Receive_Email field |
217 | |||
218 | 26 | Jon Goldberg | Here's a TSV of how to interpret the "Receive_Email" field. |
219 | |*code*|*meaning*| |
||
220 | |-24|INACTIVE: (5.1.1 User Unknown)| |
||
221 | |-26|INACTIVE: Address contains RFC spec. invalid characters / is improperly formatted| |
||
222 | |-3|INACTIVE: UNSUBSCRIBED (actively unsubscribed by user)| |
||
223 | |-30|INACTIVE (Reported as Spam): Other Blacklist (BLACKLIST)| |
||
224 | |-32|(Unknown Status)| |
||
225 | |-35|INACTIVE (Reported as Spam): Outblaze| |
||
226 | |-4|(Unknown Status)| |
||
227 | |-42|INACTIVE (Recipient Initiated Spam Report): MSN/Hotmail/WebTV| |
||
228 | |-44|INACTIVE (Recipient Initiated Spam Report): UNTI (Juno/NetZero/FreeServers)| |
||
229 | |-45|INACTIVE (Recipient Initiated Spam Report): Yahoo| |
||
230 | |-46|INACTIVE (Recipient Initiated Spam Report): Comcast.net| |
||
231 | |-47|INACTIVE (Recipient Initiated Spam Report): AOL| |
||
232 | |-48|INACTIVE (Recipient Initiated Spam Report): RoadRunner| |
||
233 | |-50|ISP Specific Bounces: AIM.com Unactivated account| |
||
234 | |-51|INACTIVE (Recipient Initiated Spam Report): Excite| |
||
235 | |-52|INACTIVE (Reported as Spam): Earthlink| |
||
236 | |-53|(Unknown Status)| |
||
237 | |-54|(Unknown Status)| |
||
238 | |-60|Bad Address/Expired address, etc (n.b.: These addresses are all @democracyinaction.org)| |
||
239 | |-9|INACTIVE: DEATH (supporter has died)| |
||
240 | |0|0 - Inactive or Unknown(not subscribed)| |
||
241 | |1|1 - Imported or unknown (subscribed)| |
||
242 | |10|ACTIVE: CONFIRMED (Double opt-in)| |
||
243 | 1 | Jon Goldberg | |3|ACTIVE: CLIENT (Client has directly signed up)| |