fix traces when migrating documents