The first time a young person deleted the database and ran away
The cause of this incident was ServerChan, but the ability to successfully restore to the most recent state (after midnight?) was also thanks to ServerChan.
Around ten past midnight, I updated ServerChan and restarted the server (the server backs up every time it starts). Then zyf helped me log in.
I disabled Xbox verification and saw the backups in the worlds folder. According to zyf, the archive is backed up once a day. However, since the server actually restarts frequently, there were several extra backups. I didn't like it, so I selected these backups, clicked delete-confirm. However, I was fooled. Damn VSCode selected the worlds folder when I expanded the worlds folder. So the entire worlds folder, including the archives and backups, were all deleted.
But I didn't notice and still started the server. I found it was a brand new world. It wasn't until I opened the worlds folder that I realized everything was gone.
But the clever me quickly found the powerful tool extundelete. By renting another server (thanks to the sponsor zyf), mounting the original system disk as a data disk, and then executing
extundelete /dev/vdb1 --restore-file /root/worlds
extundelete successfully scanned and pretended to recover two backups...
Then I found that only one block file was recovered, which was obviously no different from having nothing.
Later, I tried foremost and found that the recovered file names were unrecognizable, completely unusable. Because the block file names are also random numbers, there is no way to correspond one by one with the recovered files.
Then I found that extundelete also has a parameter to restore directories
extundelete /dev/vdb1 --restore-directory /root/worlds
But it kept saying "not such directory." After checking, I found that I hadn't specified the output directory, adding -o shit fixed it.
The correct backup that was recovered, the most recent backup, the backup saved just after updating ServerChan, was actually buried in the first batch of unrecovered junk folders...
Copying the backup back, starting the server - OK.