Merge "Create new logic for grid migration" into tm-dev