I am creating a web application and want to put it on a server.
I have a server machine that run Windows 2008 R2 Server with a SQL Server 2008 database all set up and ready to use.
Can I put my application on that system or should I upgrade it to Windows 2012 or 2019 server, while also upgrading SQL Server with it?
Note: I was using XAMPP for testing, will SQL Server 2008 be as easy as connecting to PHPmyadmin database in XAMPP?
SQL Server 2019 is not supported on Windows Server 2008 R2, which is in any case heavily out-of-date and insecure.
If you wanted to go with a direct upgrade path for your existing server, you must:
Do not do any of the above. As you can see, it's complex, with multiple points of failure.
Just start with a new Windows Server 2022 image, and install SQL Server 2019.
Then do a backup/restore of all your user databases from your SQL Server 2008 R2 to the new machine. Consider updating the compatibilty level, as well as other database-scoped settings.