I tried to get Unreal 5 directly but I couldn't, the only option on the table was unreal 4.27, can I upgrade to 5 after 4.27 or do I need to consume another 20 gigs for 5?
\$\begingroup\$ "I tried to get Unreal 5 directly but I couldn't" - what stopped you? This might be relevant to what obstacles may face you in your upgrade attempt too. \$\endgroup\$– DMGregory ♦Jun 11, 2022 at 11:39
\$\begingroup\$ @DMGregory I do not know whether you believe it or not, but until last night when I left this post, it did not show any option to download Unreal 5 at all. After I downloaded Unreal 4, I realized that the option to download Unreal 5 also came, I do not know if it was a bug or not, but I have to consume about 40 gigs to download it. From where Iran's IP is blocked. I may have encountered a problem with not updating with VPN. \$\endgroup\$– KiynLJun 11, 2022 at 11:57
\$\begingroup\$ It's not clear to me from that message whether your problem is 1) The button is not available, 2) The download is larger than you can afford, 3) Your IP is blocked from downloading Unreal, or 4) An unspecified problem with your VPN. Please clarify. Also, if Epic has blocked users in Iran from downloading this software, it may be for legal reasons, in which case users who help you bypass this restriction could be contributing to illegal activity - that's something StackExchange cannot host for you. (I am not a lawyer and this message is not legal advice). \$\endgroup\$– DMGregory ♦Jun 11, 2022 at 12:01
\$\begingroup\$ @DMGregory Thanks for your non-legal advice, yes the download button didn't show. But my question was whether I could update 4 to 5 after Unreal, which solved the problem last night. (off-Topic: There is no legal reason for the IP of Iran to be blocked, because the US government's problem is with the Iranian regime, not the Iranian people, such irrational laws only cause problems for the people and do not put any pressure on the regime. +The Iranian regime has also targeted a plane with Iranian and Canadian passengers. Do not worry about helping others, our lives are not safe here either.) \$\endgroup\$– KiynLJun 11, 2022 at 12:30
You cannot upgrade your installation to 5.X, as major unreal engine versions are separate installations (i.e. 4.26, 4.27, 5.0, 5.1, and 5.2 are all their own installation). You would have to download your desired 5.X version separately.
However, if you download 4.27.2, for example, if there ever is a 4.27.3 it will download the new files to the 4.27.2 installation, changing it to 4.27.3.
If you're asking if you can change your project's unreal engine version, then yes, you can freely change what engine version your project uses (if installed of course). For example, you can change your project from using 4.27 to using 5.2, but keep in mind that there are many deprecated features in newer versions from older versions.
Changing the project version is as easy as right-clicking on the project file -> switch unreal engine version context option.