Replacing the SSD (on a frame.work 13)

The fake user linuxbrew is such a case.

Maybe better option would be copying brew list output and reinstalling them? That would ensure all intricacies and links are placed correctly. Their configs are in your user files, anyway.

There are possibly some /etc files that will need to be recovered as well.
What is the best way to handle them?

See this comment and that whole thread in general.