Secur, I had this, my 2.5yo decided our bed was beter than his when I was pg. I eventually got him out by telling him that now I was so fat there was no room for him, and had a few nights of very firmly putting him back in bed when he got out. We had a lot of tantrums, and when things got really bad we put him in a travel cot in his room, instead of his bed, which he can't get out of. He hated that, and after about 5 mins in the travel cot he would usually agree to go to bed and stay there.
Recently he has started to be scared of the dark, so we asked him if he wanted to go "camping" in dd's room, which was met with great enthusiasm, so for the last week they have been sharing a room. They both like having someone in their room at night and it has worked really well.
Good luck, bit of a nightmare really but you should be able to sort it out in a few nights. Those nights may be a bit broken though!