Add migrate terms functionality