You can have both CS4 and CS5 installed on the computer at the same time.
after you install CS5, on first launch it will recognize the extensions you have installed in CS4 and ask if you want to import them. Though this simplifies the process, the import procedure is not very reliable. It is best practice to answer NO at this prompt and download / Install the extensions manually into the CS5 extension manager.