SONAR-4895 Improve migration to correctly populate root_id and add root id in characteristic API