You would film each actor with his/her corresponding wall. Then, in a program like After Effects, you would want to draw a mask around the back of each walkoing character to introduce the new wall.
Just masking and more masking. This task doesn’t sound too difficult though. Just takes some time.