Migrate Old Boundary Data - Steps

Overview

This document provides information on migrating location data from an older JSON-based configuration to a newly developed boundary service. A boundary-migration service has been created to facilitate this process. Users can migrate the data to the new boundary service by calling a single API.

Steps

Below is the step-by-step procedure for the same:-

  1. Import the boundary migration service from here in an IDE (preferably IntelliJ) and start the service after building it.

  2. Copy the boundary-data JSON that needs to be migrated as an example we are taking boundary-data of Phagwara (Punjab). and adding RequestInfo inside this as shown below.

{
	“RequestInfo”: {} ,
	“tenantId”: ”default” ,
    “moduleName”: “egov-location” ,
    “TenantBoundary”: []
}
  1. Open Postman and create a new HTTP endpoint with a path as

http://localhost:8081/boundary/_migrate

and the above as the endpoint request body.

PS: The boundary-migration service is assumed to run on port 8081. If it is running on a different port, check the active port and update the path accordingly.

  1. Send the request and if the endpoint path and request body are correct the response would be 200 OK.

Below is a reference CURL:

curl --location 'http://localhost:8081/boundary/_migrate' \
--header 'Content-Type: application/json' \
--data '{
    "RequestInfo": {
        "apiId": "string",
        "ver": "string",
        "ts": 0,
        "action": "string",
        "did": "string",
        "key": "string",
        "msgId": "string",
        "requesterId": "string",
        "authToken": "string",
        "userInfo": {
            "tenantId": "string",
            "id": 0,
            "uuid": "string"
        }
    },
    "tenantId": "pb.phagwara",
    "moduleName": "egov-location",
    "TenantBoundary": [
        {
            "hierarchyType": {
                "code": "ADMIN",
                "name": "ADMIN"
            },
            "boundary": {
                "id": 1,
                "boundaryNum": 1,
                "name": "Phagwara",
                "localname": "Phagwara",
                "longitude": null,
                "latitude": null,
                "label": "City",
                "code": "pb.phagwara",
                "children": [
                    {
                        "id": "4b486f04-4f31-4cf7-bf03-62d725ace784",
                        "boundaryNum": 1,
                        "name": "Phagwara",
                        "localname": "Phagwara",
                        "longitude": null,
                        "latitude": null,
                        "label": "Zone",
                        "code": "PZN1",
                        "children": [
                            {
                                "id": "2583e7a6-140d-4f3c-9543-d7693849ed24",
                                "boundaryNum": 1,
                                "name": "WARD_1",
                                "localname": "WARD_1",
                                "longitude": null,
                                "latitude": null,
                                "label": "Block",
                                "code": "WARD1",
                                "children": []
                            },
                            {
                                "id": "b0b952ee-f53c-4c73-8063-be718fd93cdd",
                                "boundaryNum": 1,
                                "name": "WARD_2",
                                "localname": "WARD_2",
                                "longitude": null,
                                "latitude": null,
                                "label": "Block",
                                "code": "WARD2",
                                "children": [
                                    {
                                        "id": "3b0cdbae-b942-42fa-a03b-70c04e00d53d",
                                        "boundaryNum": 1,
                                        "name": "Asha Park Colony",
                                        "localname": "Asha Park Colony",
                                        "longitude": null,
                                        "latitude": null,
                                        "label": "Locality",
                                        "code": "PLC10",
                                        "area": "",
                                        "children": []
                                    },
                                    {
                                        "id": "ecf7079e-d3a4-4732-ad87-0b00b7b725bc",
                                        "boundaryNum": 1,
                                        "name": "Bhai Ghanaiya Ji Enclave",
                                        "localname": "Bhai Ghanaiya Ji Enclave",
                                        "longitude": null,
                                        "latitude": null,
                                        "label": "Locality",
                                        "code": "PLC25",
                                        "area": "",
                                        "children": []
                                    },
                                    {
                                        "id": "6d7d2816-f299-4618-b351-fa0699f246c7",
                                        "boundaryNum": 1,
                                        "name": "Bhai Ghanaiya Ji Nagar",
                                        "localname": "Bhai Ghanaiya Ji Nagar",
                                        "longitude": null,
                                        "latitude": null,
                                        "label": "Locality",
                                        "code": "PLC26",
                                        "area": "",
                                        "children": []
                                    },
                                    {
                                        "id": "170d78ed-726c-46a0-a8dc-242a7c81c038",
                                        "boundaryNum": 1,
                                        "name": "Chahal Nagar",
                                        "localname": "Chahal Nagar",
                                        "longitude": null,
                                        "latitude": null,
                                        "label": "Locality",
                                        "code": "PLC33",
                                        "area": "",
                                        "children": []
                                    },
                                    {
                                        "id": "91c96922-e36a-4a56-b2da-5a9c28787c07",
                                        "boundaryNum": 1,
                                        "name": "Dashmesh Nagar",
                                        "localname": "Dashmesh Nagar",
                                        "longitude": null,
                                        "latitude": null,
                                        "label": "Locality",
                                        "code": "PLC40",
                                        "area": "",
                                        "children": []
                                    },
                                    {
                                        "id": "307a4bc9-d238-4159-8727-32481c1514a6",
                                        "boundaryNum": 1,
                                        "name": "Green Park",
                                        "localname": "Green Park",
                                        "longitude": null,
                                        "latitude": null,
                                        "label": "Locality",
                                        "code": "PLC65",
                                        "area": "",
                                        "children": []
                                    },
                                    {
                                        "id": "98c41dd3-e192-415d-b225-1ddd48e6dbb8",
                                        "boundaryNum": 1,
                                        "name": "MANAV ENCLAVE",
                                        "localname": "MANAV ENCLAVE",
                                        "longitude": null,
                                        "latitude": null,
                                        "label": "Locality",
                                        "code": "PLC109",
                                        "area": "",
                                        "children": []
                                    },
                                    {
                                        "id": "deb0e5fe-aafe-436c-823c-9bc1d0c5d330",
                                        "boundaryNum": 1,
                                        "name": "N.R.I Enclave",
                                        "localname": "N.R.I Enclave",
                                        "longitude": null,
                                        "latitude": null,
                                        "label": "Locality",
                                        "code": "PLC124",
                                        "area": "",
                                        "children": []
                                    },
                                    {
                                        "id": "ea4caa8b-abe5-4526-8ec6-21fb9573989a",
                                        "boundaryNum": 1,
                                        "name": "New Vishwakarma Nagar",
                                        "localname": "New Vishwakarma Nagar",
                                        "longitude": null,
                                        "latitude": null,
                                        "label": "Locality",
                                        "code": "PLC138",
                                        "area": "",
                                        "children": []
                                    },
                                    {
                                        "id": "72614980-5782-4671-8080-95deecd28012",
                                        "boundaryNum": 1,
                                        "name": "Raja Garden Colony",
                                        "localname": "Raja Garden Colony",
                                        "longitude": null,
                                        "latitude": null,
                                        "label": "Locality",
                                        "code": "PLC164",
                                        "area": "",
                                        "children": []
                                    }
                                ]
                            },
                            {
                                "id": "5e19000e-7fa1-48d0-9f56-8e16d47919dc",
                                "boundaryNum": 1,
                                "name": "WARD_3",
                                "localname": "WARD_3",
                                "longitude": null,
                                "latitude": null,
                                "label": "Block",
                                "code": "WARD3",
                                "children": [
                                    {
                                        "id": "9bf79ce5-5bf9-44fd-a769-8a2b5258d3a9",
                                        "boundaryNum": 1,
                                        "name": "Ashok Vihar",
                                        "localname": "Ashok Vihar",
                                        "longitude": null,
                                        "latitude": null,
                                        "label": "Locality",
                                        "code": "PLC11",
                                        "area": "",
                                        "children": []
                                    },
                                    {
                                        "id": "5fddef40-00ab-406d-9b10-26bc24d8b9c8",
                                        "boundaryNum": 1,
                                        "name": "DR. SATISH NAGAR",
                                        "localname": "DR. SATISH NAGAR",
                                        "longitude": null,
                                        "latitude": null,
                                        "label": "Locality",
                                        "code": "PLC48",
                                        "area": "",
                                        "children": []
                                    },
                                    {
                                        "id": "78717620-b84b-4514-bc49-294bf3129e3b",
                                        "boundaryNum": 1,
                                        "name": "Green Avenue",
                                        "localname": "Green Avenue",
                                        "longitude": null,
                                        "latitude": null,
                                        "label": "Locality",
                                        "code": "PLC62",
                                        "area": "",
                                        "children": []
                                    },
                                    {
                                        "id": "6a3431c3-82b3-4509-a600-9f05e0682f27",
                                        "boundaryNum": 1,
                                        "name": "Green Valley",
                                        "localname": "Green Valley",
                                        "longitude": null,
                                        "latitude": null,
                                        "label": "Locality",
                                        "code": "PLC66",
                                        "area": "",
                                        "children": []
                                    },
                                    {
                                        "id": "a83f4eaf-41b3-43c7-9959-aafb4192b6ce",
                                        "boundaryNum": 1,
                                        "name": "Guru Nanak Nagar",
                                        "localname": "Guru Nanak Nagar",
                                        "longitude": null,
                                        "latitude": null,
                                        "label": "Locality",
                                        "code": "PLC71",
                                        "area": "",
                                        "children": []
                                    },
                                    {
                                        "id": "818b618b-de9e-4e21-9004-ef0fb0cc027c",
                                        "boundaryNum": 1,
                                        "name": "Hajipur",
                                        "localname": "Hajipur",
                                        "longitude": null,
                                        "latitude": null,
                                        "label": "Locality",
                                        "code": "PLC76",
                                        "area": "",
                                        "children": []
                                    },
                                    {
                                        "id": "2dc07769-a1b3-4505-9462-f6d9dc9bff30",
                                        "boundaryNum": 1,
                                        "name": "HARGOBIND ENCLAVE",
                                        "localname": "HARGOBIND ENCLAVE",
                                        "longitude": null,
                                        "latitude": null,
                                        "label": "Locality",
                                        "code": "PLC80",
                                        "area": "",
                                        "children": []
                                    },
                                    {
                                        "id": "1d600e07-0c64-45b9-9ae3-bba018d3d8c9",
                                        "boundaryNum": 1,
                                        "name": "Jeewan Nagar",
                                        "localname": "Jeewan Nagar",
                                        "longitude": null,
                                        "latitude": null,
                                        "label": "Locality",
                                        "code": "PLC89",
                                        "area": "",
                                        "children": []
                                    },
                                    {
                                        "id": "b8b69483-47e9-4c34-aac8-ca8ff851996a",
                                        "boundaryNum": 1,
                                        "name": "Khera Masit",
                                        "localname": "Khera Masit",
                                        "longitude": null,
                                        "latitude": null,
                                        "label": "Locality",
                                        "code": "PLC99",
                                        "area": "",
                                        "children": []
                                    },
                                    {
                                        "id": "2427abd1-031f-48e6-9451-3b9c84bf2e7c",
                                        "boundaryNum": 1,
                                        "name": "Kirti Nagar",
                                        "localname": "Kirti Nagar",
                                        "longitude": null,
                                        "latitude": null,
                                        "label": "Locality",
                                        "code": "PLC103",
                                        "area": "",
                                        "children": []
                                    },
                                    {
                                        "id": "940b4fad-9d75-43a0-b5de-ab4085293ff5",
                                        "boundaryNum": 1,
                                        "name": "MAIN KHALWARA ROAD",
                                        "localname": "MAIN KHALWARA ROAD",
                                        "longitude": null,
                                        "latitude": null,
                                        "label": "Locality",
                                        "code": "PLC108",
                                        "area": "",
                                        "children": []
                                    },
                                    {
                                        "id": "8976b9d9-a131-4e86-8854-e11d58f915b0",
                                        "boundaryNum": 1,
                                        "name": "NORTH AVENUE",
                                        "localname": "NORTH AVENUE",
                                        "longitude": null,
                                        "latitude": null,
                                        "label": "Locality",
                                        "code": "PLC140",
                                        "area": "",
                                        "children": []
                                    },
                                    {
                                        "id": "28303ef9-6448-46c4-8846-3d7d353d095b",
                                        "boundaryNum": 1,
                                        "name": "Palahi Road",
                                        "localname": "Palahi Road",
                                        "longitude": null,
                                        "latitude": null,
                                        "label": "Locality",
                                        "code": "PLC145",
                                        "area": "",
                                        "children": []
                                    },
                                    {
                                        "id": "01e9ee24-6012-4646-b5fa-b50d69ee9deb",
                                        "boundaryNum": 1,
                                        "name": "Parmar Colony",
                                        "localname": "Parmar Colony",
                                        "longitude": null,
                                        "latitude": null,
                                        "label": "Locality",
                                        "code": "PLC148",
                                        "area": "",
                                        "children": []
                                    }
                                ]
                            },
                            {
                                "id": "87a38051-b43f-4791-949a-157e332f33b2",
                                "boundaryNum": 1,
                                "name": "WARD_4",
                                "localname": "WARD_4",
                                "longitude": null,
                                "latitude": null,
                                "label": "Block",
                                "code": "WARD4",
                                "children": [
                                    {
                                        "id": "48a2fbe5-ad7f-437d-9c42-6fded5532e02",
                                        "boundaryNum": 1,
                                        "name": "Dharam Kot",
                                        "localname": "Dharam Kot",
                                        "longitude": null,
                                        "latitude": null,
                                        "label": "Locality",
                                        "code": "PLC44",
                                        "area": "",
                                        "children": []
                                    },
                                    {
                                        "id": "5b8ee409-ac4c-4355-bc8f-a615b0839d60",
                                        "boundaryNum": 1,
                                        "name": "G T Road To Hoshiarpur Road",
                                        "localname": "G T Road To Hoshiarpur Road",
                                        "longitude": null,
                                        "latitude": null,
                                        "label": "Locality",
                                        "code": "PLC52",
                                        "area": "",
                                        "children": []
                                    },
                                    {
                                        "id": "946d6577-622d-40eb-96e8-ed05c68f414e",
                                        "boundaryNum": 1,
                                        "name": "Guru Nanak Avenue",
                                        "localname": "Guru Nanak Avenue",
                                        "longitude": null,
                                        "latitude": null,
                                        "label": "Locality",
                                        "code": "PLC69",
                                        "area": "",
                                        "children": []
                                    },
                                    {
                                        "id": "ce998365-0449-4420-b1c9-ebc0cde22b10",
                                        "boundaryNum": 1,
                                        "name": "Pritam Nagar",
                                        "localname": "Pritam Nagar",
                                        "longitude": null,
                                        "latitude": null,
                                        "label": "Locality",
                                        "code": "PLC156",
                                        "area": "",
                                        "children": []
                                    },
                                    {
                                        "id": "4315333c-eb5d-4755-9a3f-28a37ab527d7",
                                        "boundaryNum": 1,
                                        "name": "S.P Colony",
                                        "localname": "S.P Colony",
                                        "longitude": null,
                                        "latitude": null,
                                        "label": "Locality",
                                        "code": "PLC172",
                                        "area": "",
                                        "children": []
                                    }
                                ]
                            },
                            {
                                "id": "f2dbff50-dd13-4ae0-ba14-4e5957f040c4",
                                "boundaryNum": 1,
                                "name": "WARD_5",
                                "localname": "WARD_5",
                                "longitude": null,
                                "latitude": null,
                                "label": "Block",
                                "code": "WARD5",
                                "children": [
                                    {
                                        "id": "2f05cf03-cbdc-4d1c-8989-4ef8be7a5dac",
                                        "boundaryNum": 1,
                                        "name": "Baba Gadhia To Dana Mandi",
                                        "localname": "Baba Gadhia To Dana Mandi",
                                        "longitude": null,
                                        "latitude": null,
                                        "label": "Locality",
                                        "code": "PLC15",
                                        "area": "",
                                        "children": []
                                    },
                                    {
                                        "id": "01b014f3-e54f-4472-a0df-8b513127ced9",
                                        "boundaryNum": 1,
                                        "name": "Bhularai Road",
                                        "localname": "Bhularai Road",
                                        "longitude": null,
                                        "latitude": null,
                                        "label": "Locality",
                                        "code": "PLC28",
                                        "area": "",
                                        "children": []
                                    },
                                    {
                                        "id": "23d91c85-332c-4efe-9b41-0507063ab65f",
                                        "boundaryNum": 1,
                                        "name": "City Heart Colony",
                                        "localname": "City Heart Colony",
                                        "longitude": null,
                                        "latitude": null,
                                        "label": "Locality",
                                        "code": "PLC36",
                                        "area": "",
                                        "children": []
                                    },
                                    {
                                        "id": "2c1891e0-adef-47e9-8e5e-77e4f2e0174c",
                                        "boundaryNum": 1,
                                        "name": "Guru Nanak Enclave",
                                        "localname": "Guru Nanak Enclave",
                                        "longitude": null,
                                        "latitude": null,
                                        "label": "Locality",
                                        "code": "PLC70",
                                        "area": "",
                                        "children": []
                                    },
                                    {
                                        "id": "23bdace2-452c-4b86-aca8-0f6123453487",
                                        "boundaryNum": 1,
                                        "name": "Purewal Nagar",
                                        "localname": "Purewal Nagar",
                                        "longitude": null,
                                        "latitude": null,
                                        "label": "Locality",
                                        "code": "PLC161",
                                        "area": "",
                                        "children": []
                                    },
                                    {
                                        "id": "ba7454af-1e75-463a-bd92-8b8aeb43261f",
                                        "boundaryNum": 1,
                                        "name": "Ranjit Nagar",
                                        "localname": "Ranjit Nagar",
                                        "longitude": null,
                                        "latitude": null,
                                        "label": "Locality",
                                        "code": "PLC166",
                                        "area": "",
                                        "children": []
                                    },
                                    {
                                        "id": "d09b83b0-824b-4b91-8401-29d496264911",
                                        "boundaryNum": 1,
                                        "name": "Ru Pinjni Mohalla",
                                        "localname": "Ru Pinjni Mohalla",
                                        "longitude": null,
                                        "latitude": null,
                                        "label": "Locality",
                                        "code": "PLC171",
                                        "area": "",
                                        "children": []
                                    },
                                    {
                                        "id": "7eb5cb43-e1d9-405f-813c-394812bb2372",
                                        "boundaryNum": 1,
                                        "name": "Sahibzada Ajit Singh Nagar",
                                        "localname": "Sahibzada Ajit Singh Nagar",
                                        "longitude": null,
                                        "latitude": null,
                                        "label": "Locality",
                                        "code": "PLC175",
                                        "area": "",
                                        "children": []
                                    }
                                ]
                            },
                            {
                                "id": "3de89762-d4c6-482f-b571-d5e77d024f6f",
                                "boundaryNum": 1,
                                "name": "WARD_6",
                                "localname": "WARD_6",
                                "longitude": null,
                                "latitude": null,
                                "label": "Block",
                                "code": "WARD6",
                                "children": [
                                    {
                                        "id": "c90172a0-9b37-4aa0-8b17-a6f3d162f773",
                                        "boundaryNum": 1,
                                        "name": "Amar Nagar",
                                        "localname": "Amar Nagar",
                                        "longitude": null,
                                        "latitude": null,
                                        "label": "Locality",
                                        "code": "PLC5",
                                        "area": "",
                                        "children": []
                                    },
                                    {
                                        "id": "1339d160-8180-4db0-b551-f34438407988",
                                        "boundaryNum": 1,
                                        "name": "Gaunspur",
                                        "localname": "Gaunspur",
                                        "longitude": null,
                                        "latitude": null,
                                        "label": "Locality",
                                        "code": "PLC56",
                                        "area": "",
                                        "children": []
                                    },
                                    {
                                        "id": "b6afc7e5-5b43-4784-a2b8-d7078c8d628b",
                                        "boundaryNum": 1,
                                        "name": "Guru Ravidas Nagar",
                                        "localname": "Guru Ravidas Nagar",
                                        "longitude": null,
                                        "latitude": null,
                                        "label": "Locality",
                                        "code": "PLC73",
                                        "area": "",
                                        "children": []
                                    },
                                    {
                                        "id": "8d75a617-1f5d-4d41-83f0-fb70b606b1bc",
                                        "boundaryNum": 1,
                                        "name": "Harkrishan Nagar",
                                        "localname": "Harkrishan Nagar",
                                        "longitude": null,
                                        "latitude": null,
                                        "label": "Locality",
                                        "code": "PLC81",
                                        "area": "",
                                        "children": []
                                    },
                                    {
                                        "id": "d111f1a9-94c2-424b-b521-119ce6f6377b",
                                        "boundaryNum": 1,
                                        "name": "Kaulsar Mohalla",
                                        "localname": "Kaulsar Mohalla",
                                        "longitude": null,
                                        "latitude": null,
                                        "label": "Locality",
                                        "code": "PLC96",
                                        "area": "",
                                        "children": []
                                    },
                                    {
                                        "id": "444a1f25-ada9-4d43-a278-1c60fc8ffafa",
                                        "boundaryNum": 1,