Hi - You can only store one library on your Mac in iCloud. You would need to pay for a month of sufficient space to store the whole library.
If you have two libraries, you can sync first one with iCloud, and then the second - but then you will effectively merge the two libraries into one.
How big are the two libraries, and where are they currently stored?
Whatever you do - take a backup before you start (icloud is not that backup). Mass changes to data can (rarely) go wrong resulting in loss of your photos. You should always have a full back up of your system before a significant upgrade, in any case.