If the database contains stats, the migration fails with a NullPointerException in R40000XWIKI6990DataMigration on line 437 called from line 751. This is due to the fact that the code on line 741 does the following:
Map<Long, Long> map = stats.poll();
and then on line 751:
convertDbId(stats.poll(), new AbstractIdConversionHibernateCallback()
But calling poll() on a LinkedList removes the first item. The call on line 751 should pass the map which was previously removed from the head of the list.