<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>James&#039; Tools and Tricks &#187; Database</title>
	<atom:link href="http://jrudd.org/wordpress/tag/database/feed/" rel="self" type="application/rss+xml" />
	<link>http://jrudd.org/wordpress</link>
	<description>Tools, Tips and Hints for managing a network.</description>
	<lastBuildDate>Mon, 26 Jul 2010 03:13:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Renaming Novell user accounts</title>
		<link>http://jrudd.org/wordpress/2008/12/28/renaming-novell-user-accounts/</link>
		<comments>http://jrudd.org/wordpress/2008/12/28/renaming-novell-user-accounts/#comments</comments>
		<pubDate>Sun, 28 Dec 2008 01:24:08 +0000</pubDate>
		<dc:creator>James Rudd</dc:creator>
				<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[Moodle]]></category>
		<category><![CDATA[Novell]]></category>
		<category><![CDATA[Utilities]]></category>
		<category><![CDATA[account]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[eDirectory]]></category>
		<category><![CDATA[home directories]]></category>
		<category><![CDATA[login names]]></category>
		<category><![CDATA[novell edirectory]]></category>
		<category><![CDATA[Password]]></category>
		<category><![CDATA[username]]></category>
		<category><![CDATA[usernames]]></category>

		<guid isPermaLink="false">http://jrudd.org/wordpress/?p=43</guid>
		<description><![CDATA[Recently we had to change the login names for around 1200 students. As part of this rename we needed to change their Novell eDirectory account and home directory. We also needed to ensure linked systems such as an LDAP authenticated Moodle site and an IDM linked Active Directory (AD) domain were properly updated. To perform <a href='http://jrudd.org/wordpress/2008/12/28/renaming-novell-user-accounts/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>Recently we had to change the login names for around 1200 students.</p>
<p>As part of this rename we needed to change their Novell eDirectory account and home directory. We also needed to ensure linked systems such as an LDAP authenticated <a href="http://moodle.org/" target="_blank">Moodle </a>site and an IDM linked Active Directory (AD) domain were properly updated.</p>
<p>To perform the user account and folder rename we used <a href="http://www.hbware.com/content/view/61/12/" target="_blank">Mass User</a> from <a href="http://www.hbware.com/" target="_blank">HBWare</a>. This is a great program we already used for creating and managing home directories and quotas. There was a small bug in the rename area, but it was quickly fixed when brought to Hans’ attention.<br />
Note: Before beginning you need to have a list of the old usernames and the new usernames.  A simple two column Excel or CSV file would be fine.</p>
<h2>Novell</h2>
<p>Create Mapping File: The mapping file is used by Mass User to know what to rename the existing username to.</p>
<p>Use <a href="http://www.novell.com/coolsolutions/tools/13908.html">NDS Report</a> ( http://www.novell.com/coolsolutions/tools/13908.html ) to create a list of all the accounts. You only want the DN and CN fields. Save this as an Excel or CSV file.</p>
<div id="attachment_50" class="wp-caption alignnone" style="width: 310px"><a href="http://jrudd.org/wordpress/wp-content/uploads/2008/12/1andsrepcontainer.png" rel="lightbox[43]"><img class="size-medium wp-image-50" title="NDS Report: Select Student OU" src="http://jrudd.org/wordpress/wp-content/uploads/2008/12/1andsrepcontainer-300x251.png" alt="NDS Report: Select Student OU" width="300" height="251" /></a><p class="wp-caption-text">NDS Report: Select Student OU</p></div>
<div id="attachment_51" class="wp-caption alignnone" style="width: 310px"><a href="http://jrudd.org/wordpress/wp-content/uploads/2008/12/1bndsrepuser.png" rel="lightbox[43]"><img class="size-medium wp-image-51" title="NDS Report: Choose only CN" src="http://jrudd.org/wordpress/wp-content/uploads/2008/12/1bndsrepuser-300x249.png" alt="NDS Report: Choose only CN" width="300" height="249" /></a><p class="wp-caption-text">NDS Report: Choose only CN</p></div>
<p>Create a new MS Access file and import the account list<br />
Import the text / excel file that lists the old and new account names.<br />
You now need to create a query that maps the cn to the old account name, and then use this to generate a list of the full old dn and the new account name.</p>
<div id="attachment_53" class="wp-caption alignnone" style="width: 310px"><a href="http://jrudd.org/wordpress/wp-content/uploads/2008/12/2aaccessmapping.png" rel="lightbox[43]"><img class="size-medium wp-image-53" title="Access: Mapping Query" src="http://jrudd.org/wordpress/wp-content/uploads/2008/12/2aaccessmapping-300x274.png" alt="Access: Mapping Query" width="300" height="274" /></a><p class="wp-caption-text">Access: Mapping Query</p></div>
<div id="attachment_54" class="wp-caption alignnone" style="width: 310px"><a href="http://jrudd.org/wordpress/wp-content/uploads/2008/12/2baccessdata.png" rel="lightbox[43]"><img class="size-medium wp-image-54" title="Access: Query Results" src="http://jrudd.org/wordpress/wp-content/uploads/2008/12/2baccessdata-300x206.png" alt="Access: Query Results" width="300" height="206" /></a><p class="wp-caption-text">Access: Query Results</p></div>
<p>You can then export this as a text file.</p>
<div id="attachment_55" class="wp-caption alignnone" style="width: 310px"><a href="http://jrudd.org/wordpress/wp-content/uploads/2008/12/2caccessexport1.png" rel="lightbox[43]"><img class="size-medium wp-image-55" title="Access: Export as Text file" src="http://jrudd.org/wordpress/wp-content/uploads/2008/12/2caccessexport1-300x195.png" alt="Access: Export as text file" width="300" height="195" /></a><p class="wp-caption-text">Access: Export as text file</p></div>
<div id="attachment_56" class="wp-caption alignnone" style="width: 310px"><a href="http://jrudd.org/wordpress/wp-content/uploads/2008/12/2daccessexport2.png" rel="lightbox[43]"><img class="size-medium wp-image-56" title="Access: Export Delimited" src="http://jrudd.org/wordpress/wp-content/uploads/2008/12/2daccessexport2-300x212.png" alt="Access: Export Delimited" width="300" height="212" /></a><p class="wp-caption-text">Access: Export Delimited</p></div>
<p>You will need to set the field separate as ‘=’ and set the test qualifier to none.</p>
<div id="attachment_57" class="wp-caption alignnone" style="width: 310px"><a href="http://jrudd.org/wordpress/wp-content/uploads/2008/12/2eaccessexport3.png" rel="lightbox[43]"><img class="size-medium wp-image-57" title="Access: Export = Delimiter and no Text Qualifier" src="http://jrudd.org/wordpress/wp-content/uploads/2008/12/2eaccessexport3-300x213.png" alt="Access: = as Delimiter and no Text Qualifier" width="300" height="213" /></a><p class="wp-caption-text">Access: = as Delimiter and no Text Qualifier</p></div>
<p>You should end up with each line having format:<br />
OLDNAME.OU.C=NEWNAME<br />
Once the mapping file is generated you can apply it either to individual OUs (e.g. year groups), or to the entire Users container. I would recommend applying to small containers initially to allow checking for errors. After verifying all renames were performed correctly you can then apply the rename to your entire users’ container.</p>
<div id="attachment_58" class="wp-caption alignnone" style="width: 310px"><a href="http://jrudd.org/wordpress/wp-content/uploads/2008/12/massuserrename.png" rel="lightbox[43]"><img class="size-medium wp-image-58" title="Mass User: Rename" src="http://jrudd.org/wordpress/wp-content/uploads/2008/12/massuserrename-300x234.png" alt="Mass User: Rename" width="300" height="234" /></a><p class="wp-caption-text">Mass User: Rename</p></div>
<h2>IDM 3.0 – Active Directory</h2>
<p>Before doing the mass rename we did some simple tests of renaming eDirectory accounts to see how they replicated to Active Directory. We determined that the individual renames were successfully propagated through IDM to automatically change the pre-2000 and logon name fields to match the new eDirectory account.<br />
When performing the mass rename of accounts, AD was checked after doing each OU to check propagation was successful. We experienced no problems with IDM and all accounts were successfully synchronised with Active Directory.</p>
<h2>Moodle</h2>
<p>For Moodle we wished for users to retain their own accounts including all their settings and course information.  To do this the username stored in the Moodle Database (DB) would need to be changed to the new username.<br />
Before making changes to Moodle I recommend putting the site in admin mode and temporarily disabling your LDAP authentication. I only put the site in Admin mode and then had problems during migration as some students had attempted to logon after I had renamed the eDirectory accounts, but before migrating Moodle accounts. This created new user accounts in Moodle that prevented the update queries running due to duplicate key name problems (ie the old account would not rename to new one if one has already been created with the new name)<br />
First you need to import your list of old and new account names into the database. If you already have it in a separate DB on your Moodle server you can use that, otherwise it is best to just to create a new table in the Moodle DB.<br />
I used this query to check the mapping fields. You will need to adjust the fields and collation types for your own setup.<br />
I use the IDNumber field to store the full DN, if you use a different field you will need to adjust this.</p>
<h3>Validation:</h3>
<p><code># Shows the current username, the new username and the new IDNumber field for validation check.<br />
SELECT mdl.`username` , ern.`StudentId` , replace( `idnumber` , mdl.`username` , ern.`StudentId`<br />
COLLATE latin1_swedish_ci )<br />
FROM moodle.`mdl_user` mdl, sbhsdata.`oasisStudentIdMap` ern<br />
WHERE mdl.`username`<br />
COLLATE latin1_general_ci = ern.`OldStudentId`</code></p>
<h3>Update:</h3>
<p><code># Replaces the IDNumber field with the new username.<br />
UPDATE moodle.`mdl_user` mdl, sbhsdata.`oasisStudentIdMap` ern<br />
SET  `idnumber` = replace( `idnumber` , mdl.`username` , ern.`StudentId` COLLATE latin1_swedish_ci )<br />
WHERE mdl.`username`<br />
COLLATE latin1_general_ci = ern.`OldStudentId`</code></p>
<p><code># Replaces the mdl_user field with the new username.<br />
UPDATE `mdl_user` mdl, `rename` ren<br />
SET  mdl.`username` = ren.`newname`<br />
WHERE mdl.`username`= ren.`oldname`</code><br />
Note: As can be seen by the queries, during the migration I did two separate updates, one to update the IDNumber field and another to update the mdl_user field. When I had completed migration I realised I had only needed to update the mdl_user field as Moodle would automatically update the value in IDNumber at next log on.</p>
<h2>Round Up</h2>
<p>The migration to the new accounts went well with no problems from student passwords or accounts, although we had a few instances of students using the old username instead of the new one.</p>
<p>Since performing the change we have also implemented a <a href="http://www.papercut.com/products/ng/">Papercut</a> system which would have required the additional step of <a href="http://www.papercut.com/kb/Main/RenameUserAccounts">renaming</a> all of its accounts to ensure student balances were carried across.</p>
]]></content:encoded>
			<wfw:commentRss>http://jrudd.org/wordpress/2008/12/28/renaming-novell-user-accounts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
