Artur
I will add a few comments from our practice.
the best way to do it - the Russians hacked the server on Hetzner and changed the records in NGINX - apparently the site on the box was not instantly updated. They confirmed it manually, ordered it. Ale does not mean that hackers have access to all database data, files, and backups, which are located on the same server. They could see everything and the efficiency of discovery is even small, as there is no Snapshot of the entire system (and it can be done manually from Hetzner's account). Techpіdtrimka it seems that the user himself is responsible for blocking the input ports. Vidpovidno first - set it up like this, so that it is protected at the entrance, for example, proxy/firewall/internal network IP.
Dali mabut varto separate code/files/database on different services. AWS/GCP may need functionality, but splitting and porting may generate only DevOps alerts. As a minimum - the code and files are left out as is, and the database is transferred to another server.
Dali about the copies themselves - varto robiti okremo backup of the database (by the way /opt/ and roam only) and files (/your_box/
www1/media do not roam) to any external server or service. Here it is necessary to work so that the access passwords are not available in the export of backups, otherwise the attackers can see the data on the backups as well.
І at the end - a dark version of the OS transfers automatically online copies of all Box data in three directions and switches to another copy may be mittevo so that you do not hesitate. This way looks like the most progressive, but maybe the most expensive.