datafile migration into 3.0

This is not really a pull request, more of a bookmark to a diff and my branch to be reviewed and tested.
Unit tests run fine apart form the LDAP tests which are skipped with the current settings.