1+ -- PURPOSE: Rename the "uMarketingSuite" Media Folder to Engage
2+ UPDATE [umbracoNode]
3+ SET text = ' Engage'
4+ WHERE nodeObjectType = ' B796F64C-1F99-4FFB-B886-4BF4BC011A9C' -- Media Type
5+ AND Text = ' uMarketingSuite' -- We can't go more specific than this as the node ID is different for each client.
6+
7+ -- PURPOSE: Renaming the DataTypeContainer & DataTypes to Engage
8+ UPDATE [umbracoNode]
9+ SET text = ' Engage'
10+ WHERE nodeObjectType = ' 521231E3-8B37-469C-9F9D-51AFC91FEB7B' -- DataTypeContainer Type
11+ AND Text = ' uMarketingSuite' -- In case some clients don't use uniqueId 'C883C2D6-E2FB-4AEA-8867-F0C71ACD5CAC'
12+
13+ -- We can go more specific here as the node's uniqueId is the same for all clients.
14+ UPDATE [umbracoNode]
15+ SET text = ' Engage - Node Picker'
16+ WHERE uniqueId = ' E5DAFA00-0393-4AE3-9734-4FF7BDEEF494'
17+
18+ UPDATE [umbracoNode]
19+ SET text = ' Engage - Time Picker'
20+ WHERE uniqueId = ' 19AEDD1B-3E4B-4E1D-B3DC-D34D6AB90754'
21+
22+ UPDATE [umbracoNode]
23+ SET text = ' Engage - Customer Journey Group Color Picker'
24+ WHERE uniqueId = ' 29AEDD1B-3E4B-4E1D-B3DC-D34D6AB90754'
25+
26+ UPDATE [umbracoNode]
27+ SET text = ' Engage - Customer Journey Icon Picker'
28+ WHERE uniqueId = ' 29AEDD2B-4E4C-4E1D-B3DC-D34D6AB90754'
29+
30+ UPDATE [umbracoNode]
31+ SET text = ' Engage - Persona Group Color Picker'
32+ WHERE uniqueId = ' 19AEDD1B-3E4B-4E1D-B3DC-C34D6AB90753'
33+
34+ UPDATE [umbracoNode]
35+ SET text = ' Engage - Persona Icon Picker'
36+ WHERE uniqueId = ' 49ADDD1B-4E3C-4E2D-B3DC-D24D6AB90756'
37+
38+ -- PURPOSE: Renaming the uMarketingSuite UserGroup to Engage
39+ UPDATE dbo.[umbracoUserGroup2App]
40+ SET app = ' engage'
41+ WHERE app = ' uMarketingSuite'
42+
43+ -- PURPOSE: Check & Insert the KeyValue State's for Engage.
44+ DECLARE @CurrentDateTime DATETIME = GETDATE ();
45+
46+ -- Check for uMarketingSuite 2.6.1+ to Engage 13.0.0
47+ IF EXISTS (
48+ SELECT 1
49+ FROM [umbracoKeyValue]
50+ WHERE [key] = ' Umbraco.Core.Upgrader.State+uMarketingSuite'
51+ AND [value] = ' SetRawCustomPageviewDataPkIndexToClustered'
52+ )
53+ BEGIN
54+ -- Insert the new key-value pair
55+ INSERT INTO [umbracoKeyValue] ([key], [value], [updated])
56+ VALUES (' Umbraco.Core.Upgrader.State+Umbraco.Engage' , ' SetupDataTypesAndSectionPermissions' , @CurrentDateTime);
57+ END
58+ ELSE
59+ BEGIN
60+ -- Raise an error if the condition is not met
61+ RAISERROR (' Cannot upgrade from this version of uMarketingSuite to Umbraco Engage. Minimum UMS version: 2.6.1' , 16 , 1 );
62+ END ;
63+
64+ -- Check for uMarketingSuite.Commerce 2.0.0+ to Engage.Commerce 13.0.0 (Only executes if it even exists)
65+ IF EXISTS (
66+ SELECT 1
67+ FROM [umbracoKeyValue]
68+ WHERE [key] = ' Umbraco.Core.Upgrader.State+uMarketingSuite.UmbracoCommerce'
69+ )
70+ BEGIN
71+ -- Key exists, now check if the value matches
72+ IF NOT EXISTS (
73+ SELECT 1
74+ FROM [umbracoKeyValue]
75+ WHERE [key] = ' Umbraco.Core.Upgrader.State+uMarketingSuite.UmbracoCommerce'
76+ AND [value] = ' CreateAnalyticsUmbracoCommerceVisitorOrderTable'
77+ )
78+ BEGIN
79+ -- Raise an error if the value does not match
80+ RAISERROR (' Cannot upgrade from this state of uMarketingSuite.Commerce to Umbraco.Engage.Commerce' , 16 , 1 );
81+ END
82+ ELSE
83+ BEGIN
84+ -- Insert the new key-value pair if the value matches
85+ INSERT INTO [umbracoKeyValue] ([key], [value], [updated])
86+ VALUES (' Umbraco.Core.Upgrader.State+Umbraco.Engage.UmbracoCommerce' , ' CreateAnalyticsUmbracoCommerceVisitorOrderTable' , @CurrentDateTime);
87+ END
88+ END ;
89+
90+ -- Check for uMarketingSuite.UmbracoForms 2.0.0+ to Engage.UmbracoForms 13.0.0 (Only executes if it even exists)
91+ IF EXISTS (
92+ SELECT 1
93+ FROM [umbracoKeyValue]
94+ WHERE [key] = ' Umbraco.Core.Upgrader.State+uMarketingSuite.UmbracoForms'
95+ )
96+ BEGIN
97+ -- Key exists, now check if the value matches
98+ IF NOT EXISTS (
99+ SELECT 1
100+ FROM [umbracoKeyValue]
101+ WHERE [key] = ' Umbraco.Core.Upgrader.State+uMarketingSuite.UmbracoForms'
102+ AND [value] = ' CreateAnalyticsUmbracoFormsSubmissionRecordTable'
103+ )
104+ BEGIN
105+ -- Raise an error if the value does not match
106+ RAISERROR (' Cannot upgrade from this state of uMarketingSuite.UmbracoForms to Umbraco.Engage.UmbracoForms' , 16 , 1 );
107+ END
108+ ELSE
109+ BEGIN
110+ -- Insert the new key-value pair if the value matches
111+ INSERT INTO [umbracoKeyValue] ([key], [value], [updated])
112+ VALUES (' Umbraco.Core.Upgrader.State+Umbraco.Engage.UmbracoForms' , ' CreateAnalyticsUmbracoFormsSubmissionRecordTable' , @CurrentDateTime);
113+ END
114+ END ;
0 commit comments