Q. My dog used to sleep with me. Now I make him sleep in the bathroom, next to me, with a gate in the doorway, but he barks all night. What can I do?
A. First, make sure he has somewhere comfortable to lay in the bathroom, such as a nice dog bed, a nice crate with a dog bed in it or a nice thick blanket. You cannot expect your dog to sleep on the hard floor all night and be comfortable.
If you really want to make this change, and you really want your dog to sleep in the bathroom, you have to ignore the dogs barking no matter what. 100% ignore the dog when he barks, especially when he begins to bark HARDER and LOUDER.
If you are ignoring your dog and he starts barking harder and louder, scratching, or yelping, this is called an "extinction burst". Basically, this is the moment before he stops trying to get your attention. He will give it all he's got for a few minutes (normally up to 30 minutes), and will finally give up.
Again, it's very important to ignore ALL the complaining if you ever want it to stop. Scolding him, telling him "no", or engaging him in any other way will only encourage him to bark more; it shows him he can get what he wants (your attention) if he barks.