Remove the hinges from the door using a power screwdriver. Lift the door up and take it off the doorway. Any door will reduce the opening of the doorway, so removing it may give you slightly more than 31 inches.
Lift the couch up and carry it over to the 31-inch doorway. Turn it slightly on its side to reduce its width. Continue turning it on its side, or on end, until you get an angle that will fit through the doorway.
Take apart the sofa yourself if you can't get an angle for it to fit through the doorway. To take apart the sofa and get it through the doorway, you'll need to first flip it over. If you're outside, lay a tarp down to protect the fabric. Then, take the fabric off the underside. It should peel back to reveal the sofa arms on either side. Pull these out to reduce the size of the sofa. Carry it through the doorway while keeping it flipped over. Reassemble once you get inside.