I have a PHP website of around 20 pages without a database on shared hosting - it has quite a lot of forms and a significant amount of visits. I have a staging subdomain on the same server wherein I have uploaded a new version of the site.
I want to replace the live site with the staging site, but I am worried if it will cause any errors or inconveniences to the users, for example those who have just clicked the submit button on a form, or any other case in general.
One option I know of is to simple copy everything from the staging site to the live site directory, and replace the old site. But I don't know how it will affect the users currently online, and it may have some consequences I am not aware of.
I think a safer approach would be to block new users from entering the site (I think it can be done using the .htaccess file), and then ensure all of the users have exited, or somehow force them to exit the site, before replacing the live site with the staging site.
Is there a better method than the above? If not, how would I make sure all of the users have exited the site before replacing it with the new one?