When doing this for Pants and Toolchain, I manually deleted the dependencies field and then ran ./pants test ::. Added back any missing deps
NB that not everything can be inferred, like files and resources. If I were to do it again, I would have also used ./pants filter --target-type to find the addresses of all of those and then probably ripgrep the diff of what I deleted to fix
A good first step could be enabling dep inference without deleting anything. Make sure that doesn't break anything. (The most that should happen is more deps being added than you had before, as it's additive)