Skip to content

Latest commit

 

History

History
94 lines (69 loc) · 3.91 KB

README.md

File metadata and controls

94 lines (69 loc) · 3.91 KB

Move record to consumed table

SQL scripts to move applicant_demographic, applicant_document and reg_appointment table to respective CONSUMED tables based on createdDt or lastUpdatedDt whichever is latest.

steps to run

  1. Update startDate and endDate in ArchivalScript.sql.
  2. Execute this command psql -h host -U username -d database -f ArchivalScript.sql.

Migration Utility

Overview

In 1.1.3 version of MOSIP, the encryption key was REGISTRATION which is now changed to a new key PRE_REGISTRATION in 1.1.5.
This utility helps in migrating data from the 1.1.3 to the 1.1.5 version of MOSIP.

Note:- This utility is applicable for migration from MOSIP version 1.1.5 to 1.2.0.1. This is applicable even if version 1.1.5 has the old encryption key (REGISTRATION).

Scenario 1- Two different environments

Source Environment : 1.1.3 has a set of keys generated and data is encrypted with this set of keys.
Destination Environment : 1.1.5 has a set of keys generated (different keys here, totally a new environment).
In this scenario, the data gets decrypted with 1.1.3 environment keys and then encrypts with 1.1.5 environment keys.

Scenario 2- Same environment

In this scenario 1.1.5 version of MOSIP is upgraded but no new keys gets generated here and it is just an application upgrade.
Hence, the data will be decrypted with the upgraded version of MOSIP and encrypted with the upgraded version of MOSIP.

Prerequisites

  1. Update Properties from here.
  2. Run Config Server
  3. Key-Manager Service should be running.
  4. mosip_prereg database and minio should be there in source and destination environments.

Steps to run the utility

Linux (Docker)

  1. Pull the latest docker from the command below.
docker pull mosipdev/pre-reg-113-115:develop
  1. Run docker image using the below command.
docker run re-encrypt-utility

Properties files details

  1. For Scenario 1, set isNewDatabase property to "true" and for Scenario 2, set isNewDatabase property to "false".
isNewDatabase=true
  1. Change the below properties in application.properties.
datasource.primary.jdbcUrl=jdbc:postgresql://{jdbc url}:{port}/{primary database name}
datasource.primary.username={username}
datasource.primary.password={password}
datasource.primary.driver-class-name=org.postgresql.Driver

mosip.base.url={Base URL for decryption}
cryptoResource.url=${mosip.base.url}/v1/keymanager

appId={appId}
clientId={clientId}
secretKey={secretKey}

decryptBaseUrl=${mosip.base.url}
encryptBaseUrl={encryptBaseUrl}

object.store.s3.url={object store url}
object.store.s3.accesskey={object store accesskey}
object.store.s3.secretkey={object store secretkey}

decryptAppId={app id for decryption}
decryptReferenceId={reference id for decryption}

encryptAppId={app id for encryption}
encryptReferenceId={reference id for encryption}

  1. For Scenario 1 (Source and destination Environments), change the below properties in the application.properties.
datasource.secondary.jdbcUrl=jdbc:postgresql://{jdbc url}:{port}/{secondary database name}
datasource.secondary.username={username}
datasource.secondary.password={password}
datasource.secondary.driver-class-name=org.postgresql.Driver

destinationObjectStore.s3.url={destination object store url}
destinationObjectStore.s3.access-key={destination object store accesskey}
destinationObjectStore.s3.secret-key={destination object store secretkey}