-
Notifications
You must be signed in to change notification settings - Fork 0
Merge user procedure
From time to time it happens that the lookup service for people returns multiple records for the same name, even though one of them is an active user, and the others are inactive. This happens because the update procedure (that uses LDAP as source material) can only merge person records based on shared ugent identifiers. When that is not the case, duplicate records start to appear and records that are not found anymore in LDAP are marked as inactive.
Even more some publications or datasets may have been attached already to those inactive users.
When that happens the following procedure needs to take place:
- Inspect the MongoDB collection
person
in databaseauthority
in order to determine the internal record identifiers, and what record is the active one:
> db.person.findOne({ugent_id: {$in: ["978247705993"]}})
{
"_id" : "23ab5647-38e0-11eb-9f20-f752cd0b59b4",
"active": 1
...
}
> db.person.findOne({ugent_id: {$in: ["870110443455"]}})
{
"_id": "FF0A54C6-F0ED-11E1-A9DE-61C894A0A6B4",
"active": 0
...
}
The internal record identifiers are here:
23ab5647-38e0-11eb-9f20-f752cd0b59b4
FF0A54C6-F0ED-11E1-A9DE-61C894A0A6B4
- Transfer publications for the inactive person record to the active person
Use the gRPC client:
./client publication transfer <inactive-id> <active-id>
Example
./client publication transfer FF0A54C6-F0ED-11E1-A9DE-61C894A0A6B4 23ab5647-38e0-11eb-9f20-f752cd0b59b4
Repeat above command per inactive person record
This makes sure that more inactive person records are attached to a publication. Now the old person records can be merged safely into the new person records, and the old person records can be removed.
- Merge old (inactive) person records into new (active) person record
# login via ssh to persse.ugent.be
ssh persse
# switch to user biblio
sudo bash
su - biblio
cd /opt/biblio
# merge old person record into active one. Repeat this per inactive person record
bin/exec.sh catmandu replace_user --old FF0A54C6-F0ED-11E1-A9DE-61C894A0A6B4 --new 23ab5647-38e0-11eb-9f20-f752cd0b59b4
Important notes:
- the old person identifier (
FF0A54C6-F0ED-11E1-A9DE-61C894A0A6B4
in this case) is added to attributeids
of the active person record (23ab5647-38e0-11eb-9f20-f752cd0b59b4
). So https://biblio.ugent.be/person/FF0A54C6-F0ED-11E1-A9DE-61C894A0A6B4 will still work and return the same publications as https://biblio.ugent.be/person/23ab5647-38e0-11eb-9f20-f752cd0b59b4 - the old person is remove