josephlacey / com.jlacey.electoral

GNU Affero General Public License v3.0
6 stars 12 forks source link

Steps to update from v2 to v3 version #36

Open privaterra opened 3 years ago

privaterra commented 3 years ago

I actually just upgraded from v2 to v3 of the electoral extension. Let me share the steps I followed:

1. Delete the v2 electoral related custom fields …

This can not be done within CiviCRM, so I used phpMyAdmin …

2. Log into CiviCRM

3. Uninstalled the v2 Electoral Extension

Administer / System Settings / Extension - Disable and then uninstall the v2 Electoral extension

4. Delete the v2 Electoral extension files

5. Fetch the v3 Electoral extension files

 cd /var/www/html/wp-content/uploads/civicrm
 git clone https://github.com/MegaphoneJon/com.jlacey.electoral.git

sudo chown -R www-data:www-data com.jlacey.electoral

6. Return to CiviCRM

7. Review/adjusted the settings for the v3 Electoral extension

8. Reviewed the Daily Electoral Job configuration

 limit=100
 update=false

- Enable “is this Scheduled Job active?”

jimcrist commented 3 years ago

Looks good...thanks! So, no way to save the data...got to redistrict all the data....bummer...

privaterra commented 3 years ago

You might be able to save the data. …

Export the tables before removing v2. Then import them when the new v3 tables have been added. Haven’t tried it… let me know if it works.

-- Robert Guerra Cel/Tel +1 416 893 0377 Twitter: twitter.com/netfreedom Email: @.***

On 29 Jul 2021, at 14:42, jimcrist wrote:

Looks good...thanks! So, no way to save the data...got to redistrict all the data....bummer...

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/josephlacey/com.jlacey.electoral/issues/36#issuecomment-889373800

d0325mgray commented 3 years ago

I did not perform these steps before I upgraded. I pressed the "skip" link during the database upgrade. The extension is working correctly.

I did check the database table civicrm_custom_group.

These rows were not there: electoral_districts & electoral_status. There is no column named is_reserved

privaterra commented 3 years ago

I did not perform these steps before I upgraded. I pressed the "skip" link during the database upgrade. The extension is working correctly.

I did check the database table civicrm_custom_group.

These rows were not there: electoral_districts & electoral_status. There is no column named is_reserved

I have my CiviCRM setup so that it stores its data in a separate database. Below is the structure of the civicrm_custom_group table and the two related entries.

civicrm_custom_group

CREATE TABLE `civicrm_custom_group` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Unique Custom Group ID',
  `name` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Variable name/programmatic handle for this group.',
  `title` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Friendly Name.',
  `extends` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT 'Contact' COMMENT 'Type of object this group extends (can add other options later e.g. contact_address, etc.).',
  `extends_entity_column_id` int(10) unsigned DEFAULT NULL COMMENT 'FK to civicrm_option_value.id (for option group custom_data_type.)',
  `extends_entity_column_value` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'linking custom group for dynamic object',
  `style` varchar(15) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Visual relationship between this form and its parent.',
  `collapse_display` tinyint(4) DEFAULT 0 COMMENT 'Will this group be in collapsed or expanded mode on initial display ?',
  `help_pre` text COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Description and/or help text to display before fields in form.',
  `help_post` text COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Description and/or help text to display after fields in form.',
  `weight` int(11) NOT NULL DEFAULT 1 COMMENT 'Controls display order when multiple extended property groups are setup for the same class.',
  `is_active` tinyint(4) DEFAULT 1 COMMENT 'Is this property active?',
  `table_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Name of the table that holds the values for this group.',
  `is_multiple` tinyint(4) DEFAULT 0 COMMENT 'Does this group hold multiple values?',
  `min_multiple` int(10) unsigned DEFAULT NULL COMMENT 'minimum number of multiple records (typically 0?)',
  `max_multiple` int(10) unsigned DEFAULT NULL COMMENT 'maximum number of multiple records, if 0 - no max',
  `collapse_adv_display` tinyint(4) DEFAULT 0 COMMENT 'Will this group be in collapsed or expanded mode on advanced search display ?',
  `created_id` int(10) unsigned DEFAULT NULL COMMENT 'FK to civicrm_contact, who created this custom group',
  `created_date` datetime DEFAULT NULL COMMENT 'Date and time this custom group was created.',
  `is_reserved` tinyint(4) DEFAULT 0 COMMENT 'Is this a reserved Custom Group?',
  `is_public` tinyint(4) DEFAULT 1 COMMENT 'Is this property public?',
  `icon` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'crm-i icon class',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UI_title_extends` (`title`,`extends`),
  UNIQUE KEY `UI_name_extends` (`name`,`extends`),
  KEY `FK_civicrm_custom_group_created_id` (`created_id`),
  CONSTRAINT `FK_civicrm_custom_group_created_id` FOREIGN KEY (`created_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

Electoral Districts & Electoral Status


INSERT INTO `civicrm_custom_group` (`id`, `name`, `title`, `extends`, `extends_entity_column_id`, `extends_entity_column_value`, `style`, `collapse_display`, `help_pre`, `help_post`, `weight`, `is_active`, `table_name`, `is_multiple`, `min_multiple`, `max_multiple`, `collapse_adv_display`, `created_id`, `created_date`, `is_reserved`, `is_public`, `icon`)
VALUES
    (1, 'electoral_districts', 'Electoral Districts', 'Contact', NULL, NULL, 'Tab with table', 0, NULL, NULL, 11, 1, 'civicrm_value_electoral_districts_1', 1, NULL, NULL, 0, NULL, NULL, 0, 1, NULL),
    (2, 'electoral_status', 'Electoral Status', 'Address', NULL, NULL, 'Inline', 1, NULL, NULL, 11, 1, 'civicrm_value_electoral_status_2', 0, NULL, NULL, 1, NULL, NULL, 0, 1, NULL);