Usually, we need to perform an export/import of the contacts of a user for a migration purposes.
Today, someone asked me to delete a Lync account and enable a Lync Account on a new AD account and migrate the contacts from the old one to the new one.
This is something possible with the commands “Export-csUserData” and “Update-csUserData”. Don’t use the command “import-csUserData” because it will not work.
The difference between the two commands is that “import” replace while “update” just append the data (which is not a problem as the destination is new).
The process is like this :
- Launch the command “Export-CsUserData -PoolFQDN poolname -FileName filepath.zip -UserFilter UserSipAddress“
- A zip is created containing the data
- Launch the command “Update-CsUserData -FileName filepath.zip -UserFilter UserSipAddress“
- The contacts are now in the new Lync account
If the user also changed his SIP address, then there is an extra step where you need to edit the file called DocItem in the zip file before launching the command to update.
- Open the zip file created
- Extract the file DocItemSet.xml
- Open it with text editor and replace any occurence of the old SIP address with the new one then save it.
- Replace the file previously edited in the zip file and launch the update.