Bug 41162 - Add migrationscript for UCS@school 4.1 R2
Add migrationscript for UCS@school 4.1 R2
Status: CLOSED FIXED
Product: UCS@school
Classification: Unclassified
Component: General
UCS@school 4.1 R2
Other Linux
: P5 normal (vote)
: UCS@school 4.1 R2
Assigned To: Sönke Schwardt-Krummrich
Florian Best
:
Depends on:
Blocks: 41862
  Show dependency treegraph
 
Reported: 2016-04-27 13:37 CEST by Florian Best
Modified: 2016-07-27 12:01 CEST (History)
2 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments
migration script (2.46 KB, text/x-python)
2016-05-09 10:49 CEST, Florian Best
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2016-04-27 13:37:27 CEST
The structure in UCS@school 4.1R2 will change.
We need to create a migration scripts which:
* attaches the object classes / options to all user objects
* inserts the OU into the ucsschoolSchool attribute of all users
Comment 1 Florian Best univentionstaff 2016-05-09 10:49:31 CEST
Created attachment 7642 [details]
migration script

Attached is a working script which does the required things.
Comment 2 Sönke Schwardt-Krummrich univentionstaff 2016-05-09 11:10:47 CEST
Looks good on a short visual check.
Comment 3 Sönke Schwardt-Krummrich univentionstaff 2016-06-06 23:34:32 CEST
Script has been improved a little bit. Added --dry-run and --verbose. The latter one prints the LDAP DN and LDAP modlist to stdout.

The script is placed in /usr/share/ucs-school-import/scripts with filename
ucs-school-migrate-users-to-4.1R2.

The script is called automatically by join script 35ucs-school-import.inst.
If this is not desired (e.g. due to high number of LDAP changes during update), the UCR variable "ucsschool/update/users/41R2" may be set to "false" to disable the automatic calling of the script.
In this case the execution of the script has to be performed manually later on, otherwise UCS@school may not behave correctly.

The output of the script is also copied to 
/var/log/univention/ucs-school-migrate-users-to-4.1R2.log by the join script for possible later analysis.

ucs-school-import.yaml has been updated.

A new section has been added to release-notes-ucsschool-4.1R2v1-de.xml describing the required steps to disable the automatic user object migration.

release-notes-ucsschool-4.1R2v1-de.xml:
r69860 | Bug #41162: added section for automatic LDAP user object migration

ucs-school-import (14.0.3-1):
r69858 | Bug #41162: added user migration script ucs-school-migrate-users-to-4.1R2

ucs-school-import.yaml:
r69859 | Bug #41162: updated yaml for ucs-school-import
r69861 | Bug #41162: updated yaml for ucs-school-import
Comment 4 Florian Best univentionstaff 2016-06-14 10:36:55 CEST
OK: migration of users
OK: migration of group
OK: singlemaster
OK: multiserver master
OK: skip with UCRV ucsschool/update/ldap/41R2=false
OK: YAML
Comment 5 Florian Best univentionstaff 2016-06-15 10:38:46 CEST
Maybe we should add the objectclass ucsschoolTeacher to administrator users?
Comment 6 Sönke Schwardt-Krummrich univentionstaff 2016-06-15 22:37:08 CEST
Yes, as discussed, admins behaved like a "teacher user" most of the time before UCS@school 4.1R2. To regain that behavior, I added the objectclass via the migrations script.

ucs-school-import (14.0.11-2):
r70238 | Bug #41162: add ucsschoolTeacher class to OU admins in ucs-school-migrate-objects-to-4.1R2
Comment 7 Florian Best univentionstaff 2016-06-16 00:32:11 CEST
(In reply to Sönke Schwardt-Krummrich from comment #6)
> Yes, as discussed, admins behaved like a "teacher user" most of the time
> before UCS@school 4.1R2. To regain that behavior, I added the objectclass
> via the migrations script.
> 
> ucs-school-import (14.0.11-2):
> r70238 | Bug #41162: add ucsschoolTeacher class to OU admins in
> ucs-school-migrate-objects-to-4.1R2
OK
Comment 8 Florian Best univentionstaff 2016-06-28 18:24:54 CEST
UCS@school 4.1 R2 has been released:
http://docs.software-univention.de/release-notes-ucsschool-4.1R2v1-de.pdf

If this error occurs again, please use "Clone This Bug".