If this is your situation, make the switch at least six to eight weeks before you're due. You want your older child well ensconced in his new bed before he sees the baby taking over his crib. Depending on your toddler's age and size, you could also delay the switch until the new baby is 3 or 4 months old. The newborn may spend those months sleeping in a bassinet anyway, and your older child will have time to adjust to the new baby, making the transition easier. Some children adjust easily to this change, while others don't.
Every child is different.
Your firstborn will be the one most likely to resist the transition. He may be very attached to his crib and all his associations with it. And if a new baby's on the way he'll possibly feel possessive. To ease the transition, put the bed in the same place as the crib. And of course put up a guardrail to prevent him from falling out.