BS-9894 : add the migration script
BS-9894 : fix small issues