Deleted whole site, only wanted to delete html folder

Hi,
I was cleaning on the server and wanted to delete all content in html folder of a site. By mistake I was on /home/virtual/name_of_site/ and issued the rm * -rf folder. Almost everything was deleted except etc/site_id file.
Not a problem that I deleted everything, except now that site is not visible in Control Panel so I can’t delete the site “totally”. I’d like to create it again, but it still finds somewhere something about the old site.
" 1. error(“domain %s' already attached to site id %d’”, “…”

Never muck around as root unless you absolutely need to. su DOMAIN.COM, this will put you into the account’s vfs. From there, you can remove files as the account owner - and not as root. Doing so provides additional safety that will prevent situations like this from occurring.

If you need to remove a site, always use DeleteDomain DOMAIN.COM. Never rm -rf directly! Doing so trashes the filesystem structure but leaves behind important metadata. Using DeleteDomain or the “Delete” feature in Nexus ensures all information is properly removed.

If you’d like to remove the files from a specific domain or subdomain on an account, then you can use “Uninstall” feature in Web > Web Apps. Using this ensures that any detected database is also removed from the domain.


In order to clean this up, and delete the site, we’ll need to remove vfs whiteouts from the account as well as rebuild user accounts:

First, hop on edge. I’ve added changes to mapCheck that will help in this situation.

cpcmd scope:set cp.update-policy edge-major
upcp

Assuming the site you’ve deleted is site999:

# Remove whiteouts
find /home/virtual/site999/shadow/ -type c -delete
# Flush vfs cache
systemctl reload fsmount
/usr/local/apnscp/bin/scripts/mapCheck.php rebuild
DeleteDomain site999

site999 should be removed from /home/virtual then.