You should be able to drop in the latter GPU, though my question is, how old is your PSU in that prebuilt? To add, you should remove all GPU drivers from your platform(Intel, AMD and Nvidia) before you remove your RTX3070 and reoplacing it with the RTX4070Ti.
Once you drop in the latter gen GPU, manually install the latest driver for the GPU sourced from Nvidia's support site, in an elevated command, i.e, Right click installer>Run as Administrator.
Would also be worthwhile to see if your prebuilt has any BIOS updates pending, prior to the GPU upgrade.