remove the $JBOSS_52/server/default/data/NXRuntime/repos/default/workspaces/default/index folder to force JackRabbit to rebuild the indexes

update discrimator column in NXP_LOGS table to allow this value to be null

alter table NXP_LOGS alter discriminator DROP not null

Here is the tricky part, customize the ns_idx.properties in the directory namespaces that you kept:

Compare the file $JBOSS_52/server/default/data/NXRuntime/repos/default/repository/namespaces/ns_idx.properties with the one you kept from the namespaces directory.
They contain uri and an identifier, example : http://www.nuxeo.org/ecm/schemas/common/=19
Each identifier is unique!
You need to adapt the ns_idx.properties keeped in order that each uri keep is old identifier unchanged .

Just for information, below are the changes you can make manually to update your custom_nodetypes.xml

Two main problems occurs are present in the node type definitions from Nuxeo 5.1.6:

the whole versioning features are not working : no document modification, no version increase, no reading of the previous versions, ...: this is due to the fact that ecm:version and ecm:versionHistory are not mixin type any more. Manually you can change these nodes and chose isMixin="true" to isMixin="false"

some document definitions have changed :

Workspace type has two new supertypes: ecmst:publish_ergo and ecmst:webcontainer

Forum, Thread and post types use now ecmdt:Document as supertype instead of ecmnt:document

WikiPage and BlogPost types use ecmmix:versionable as supertype instead of mix:versionable

Editing the custom_nodetypes file is not easy because you have to format this file (tidy -xml ...) to edit it. So we recommend to replace the old custom_nodetypes.xml by the new one, generated from a fresh Nuxeo 5.2 installation.