You will probably have to reinstall windows. But you can enter your activation key and wont have to buy another windows license.
Why are you replacing the z370 board for a z390? There is very little between the chipsets. With a bios update, the 9th gen CPUs will run on the z370 mobo.