migration: T6447: add traceback on error
(cherry picked from commit 1c59315e9d14a4160b6e744ded08312aa8c70d11)