> For the complete documentation index, see [llms.txt](https://docs.digit.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.digit.org/works/reference-implementations/muktasoft-v2.2/deployment/release-notes/data-migration.md).

# Data Migration

1. Remove the privacy data from additional details in the attendance tables:

```
UPDATE eg_wms_attendance_attendee SET additionaldetails = additionaldetails - 'gender' - 'identifierId' - 'individualGaurdianName' WHERE additionaldetails != 'null';
```

```
UPDATE eg_wms_attendance_summary SET additionaldetails = additionaldetails -'gender' -'mobileNo' -'fatherName' -'bankDetails' -'accountType' -'aadharNumber' -'accountHolderName' WHERE additionaldetails != 'null';
```

2. REPORT\_VIEWER is not currently used in MUKTASoft-v2.2 version, so remove the 'REPORT\_VIEWER' role from mdms-v2

```
delete from eg_mdms_data where schemacode = 'ACCESSCONTROL-ROLES.roles' and uniqueidentifier = 'REPORT_VIEWER';
```

3. Update the roles for existing CBO to access the masked information&#x20;
   * Add roles in the individual tables

```
UPDATE individual SET roles = '[{"code": "ORG_ADMIN", "name": "Organization admin", "tenantId": null, "description": null},{"code": "VIEW_ORG_UNMASKED", "name": "View ORG Unmasked", "tenantId": null, "description": null},{"code": "VIEW_DED_UNMASKED", "name": "View DED Unmasked", "tenantId": null, "description": null},{"code": "VIEW_WS_UNMASKED", "name": "View Ws Unmasked", "tenantId": null, "description": null}]'::jsonb WHERE id in (SELECT ocd.individual_id FROM eg_org_function ofn JOIN eg_org_contact_detail ocd ON ofn.org_id = ocd.org_id JOIN individual i ON ocd.individual_id =
 i.id
 WHERE ofn.category LIKE 'CBO%' AND ofn.is_active = true and i.roles != 'null' and roles != '[{"code": "CITIZEN", "name": "CITIZEN", "tenantId": null, "description": null}]');
```

* Insert role VIEW\_ORG\_UNMASKED

```
INSERT INTO eg_userrole_v1  (user_id, role_code, role_tenantId, user_tenantId, lastmodifieddate) SELECT DISTINCT t.user_id, 'VIEW_ORG_UNMASKED', 'od', 'od', '2024-11-12 15:57:41'::timestamp FROM eg_userrole_v1 t WHERE t.user_id in (SELECT i.userid::bigint FROM eg_org_function ofn JOIN eg_org_contact_detail ocd ON ofn.org_id = ocd.org_id JOIN individual i ON ocd.individual_id = i.id WHERE ofn.category LIKE 'CBO%' AND ofn.is_active = true and roles != '[{"code": "CITIZEN", "name": "CITIZEN", "tenantId": null, "description": null}]') AND NOT EXISTS (SELECT 1 FROM eg_userrole_v1 sub WHERE sub.user_id = t.user_id AND sub.role_code = 'VIEW_ORG_UNMASKED');
```

* Insert role VIEW\_DED\_UNMASKED

```
INSERT INTO eg_userrole_v1 (user_id, role_code, role_tenantId, user_tenantId, lastmodifieddate) SELECT DISTINCT t.user_id, 'VIEW_DED_UNMASKED', 'od', 'od', '2024-11-12 15:57:41'::timestamp FROM eg_userrole_v1 t WHERE t.user_id in (SELECT i.userid::bigint FROM eg_org_function ofn JOIN eg_org_contact_detail ocd ON ofn.org_id = ocd.org_id JOIN individual i ON ocd.individual_id = i.id WHERE ofn.category LIKE 'CBO%' AND ofn.is_active = true and roles != '[{"code": "CITIZEN", "name": "CITIZEN", "tenantId": null, "description": null}]') AND NOT EXISTS (SELECT 1 FROM eg_userrole_v1 sub WHERE sub.user_id = t.user_id AND sub.role_code = 'VIEW_DED_UNMASKED');
```

* Insert role VIEW\_WS\_UNMASKED

```
INSERT INTO eg_userrole_v1 (user_id, role_code, role_tenantId, user_tenantId, lastmodifieddate) SELECT DISTINCT t.user_id, 'VIEW_WS_UNMASKED', 'od', 'od', '2024-11-12 15:57:41'::timestamp FROM eg_userrole_v1 t WHERE t.user_id in (SELECT i.userid::bigint FROM eg_org_function ofn JOIN eg_org_contact_detail ocd ON ofn.org_id = ocd.org_id JOIN individual i ON ocd.individual_id = i.id WHERE ofn.category LIKE 'CBO%' AND ofn.is_active = true and roles != '[{"code": "CITIZEN", "name": "CITIZEN", "tenantId": null, "description": null}]') AND NOT EXISTS (SELECT 1 FROM eg_userrole_v1 sub WHERE sub.user_id = t.user_id AND sub.role_code = 'VIEW_WS_UNMASKED');
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.digit.org/works/reference-implementations/muktasoft-v2.2/deployment/release-notes/data-migration.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
