How to fix the issue with corrupted characters in AD data
You’ve started a migration process. Unfortunately, you get information about a failed item. In addition, on launching the CodeTwo program’s Administration Panel, you get the following or a similar error:
Error: Unable to launch application. System.Runtime.Serialization.SerializationException: There was an error deserializing the object of type C2ExchangeMigration.Common.Settings.Archive. Unexpected end of file has occurred. The following elements are not closed: StreetAddress, MigrationSource, Assignment, Assignments, Archive. Line 1, position 22297.
The error is also listed on the Bad news card. You would like to learn what’s the reason for the issue and how to fix it to complete the migration process.
Such an error usually means that the value of a certain AD attribute contains corrupted characters due to encoding issues. As a result, on reading the attribute and adding it to the XML definition file of your migration job, our program is unable to close the attribute’s XML tag and the job gets corrupted.
In the example presented above, you can see the problem concerns the StreetAddress AD attribute.
To find out the user who is assigned the problematic AD attribute and correct the data, complete the following procedure:
- Log in to the machine where your CodeTwo migration software is installed, paste the following address in the address bar of File Explorer:
and press Enter.
- You will see the root folder of our software – its name will differ depending on the product and version of the product you use (e.g. Office 365 Migration 3.2).
- Open the folder and go to Database.
- There, you’ll see XML job definition files which have been automatically created by our software (their names look like strings with random characters, see Fig. 1.).
Fig. 1. Sample XML job definition files in the Database folder.
- Open each file with a word processing app, e.g. Notepad++ or WordPad, and scroll down to the bottom, to see if it ends abruptly without a closing tag (in our example, </StreetAddress> is the missing closing tag, see Fig. 2.).
If you’ve experienced the issue recently (with the last migration job), try to sort the XML files by date modified – the most recently created/modified file is most likely the one without a closing XML tag at the end.
Fig. 2. File ends abruptly with the opening <StreetAddress> tag (the corrupted value and the closing tag are missing).
- If you finally find the corrupted XML file, you will be able to determine the affected AD user by finding the first instance of e.g. the <DisplayName> or <EmailAddress> tag above the non-closed XML tag.
- Once you know the affected user, you can delete or modify the problematic AD value for them (Fig. 3.).
Fig. 3. The value of the StreetAddress attribute with the corrupted character.
- You also need to manually delete the corrupted XML job definition file (see step 4). To be able to do it, close the program (plus stop the CodeTwo Office 365 Migration Data Provider Service if your current migration job(s) connect to the source server via MAPI).
- Finally, redefine your migration job from scratch.
Now, you should no longer experience the error and your migration process should complete successfully.
If you, however, experience the same error, it may mean there are more character encoding issues in your AD database. In such a case, you should investigate and eliminate all the issues before reattempting to migrate your data.
|Related products:||CodeTwo Exchange Migration, CodeTwo Office 365 Migration|
|Last modified:||September 29, 2021|
|Created:||September 27, 2021|