The classic example here is perhaps Hans Moravec's early ideas on mind transfer and brain simulation. I'm not sure if he gave the procedure a name (as I haven't read the original work) but it is not unreasonable to call it Moravec uploading or migration.
You will need: a system, hardware or software, capable of simulating a human brain. This is quite a tall order, but handwave away. Next, you will need a nanomechanical system that inserts a bunch of nanoscale wires into the head of the migrant, These will go in as a small number of large cables, but branch and move into place by themselves once they've been stuck in. At the end of each wire is a nanoscale system that is inserted into a braincell, records its useful contents (handwave, handwave) and builds a model of the behaviour of the cell (handwave) as its owner thinks. Probably the owner will need to be in a special virtual environment designed to trigger all sorts of mental activity to maximally exercise their brains during the process.
As the behaviour of a cell becomes modelled fully, further nanowires are inserted into the other brain cells to which the original cell was connected, and the job of sending and acting upon neural signals is taken over by the brain-simulation hardware or software.
The process then proceeds smoothly through the migrant's brain, replacing functionality braincell by braincell, so gradually that the migrant continues their thread of consciousness uninterrupted. Ideally, they should not even notice the procedure is ongoing, though they might guess as to which bits of their brain are being worked on by what their virtual environment is getting them to do (run! jump! play chess! re-enact that really embarassing moment with your first boyfriend and the cucumber!) but other than that they can just remain in the system until the migration in complete and then they will leave the virtual environment and see that they are now in a new body.
I suppose the first question to ask is: would something like this even be possible?
We don't actually have a good idea about how brains work, or even what intelligence or consciousness is. The odds seem good that they are not magical processes, and as such it should be possible to replicate them using non-magical means. So it is probably possible.
would it work, perhaps, with a body that's not a perfect replica of the one being abandoned?
That's probably a dangerous thing. There are various kinds of dysmorphia where a person can have serious psychological issues with some aspect of their body. The closer it was to their original body the better. You can always make progressive changes after you've got rid of the hard-to-maintain fleshy bit.
Of course, if you've hadnwaved in mind editting then you can fix this just fine.
A, whether it violates any known laws (aka: is this stupid?), and:
Nah, but the problem is clearly hard. Brains are complex. The whole connectome would need to be understood and duplicated, at least well enough that the migrant didn't notice the edits. Quite how high tech this is would be hard to say, but the answer is probably very and we won't be there for a while.
B, would this even be a good idea or are the alternatives better?
There are alternatives, but they are likely to prove unsatisfying for many people. Various scifi settings have backups and duplicates, but it might be hard to see those as yourself rather than other people who are increasingly unlike you or (perhaps worse) a compelling simulation of you being worn like a sockpuppet by an uncaring AI.
Other upload (or at least mind expanding) ideas exist, but they don't necessarily accomplish what you want, and if you want this sort of mind-transfer in your setting then you can feel free to handwave it in. You're the boss!