Awake for 37 hours to fix my broken website and another lesson learnt - but my Pixel 2 phone's battery held up well!
These things happen and gladly you don't know they are going to happen, but the old lesson about backing up before you do any major changes still applies. In this case, I did actually have a backup but it failed to restore because of a server side issue.
Two days back my day started as normal with me waking up at 11am (well I'm on leave and only go to sleep usually at 2am) and my challenge for that day was to fix some mixed SLL errors on my Drupal website and to add Disqus comments functionality. I did do my Softaculous backup before I started, which backs up the files data as well as the database. But neither of these two changes I was planning were expected to create any fatal errors, but stupidity is guaranteed to be fatal ;-)
So I did my fixes and struggled quite a bit to only get Disqus comments to appear on specific static pages instead of all pages (I'm rusty after not doing any heavy Drupal lifting for many months). So by 10pm it was all done and shining nicely. Whoops, I should have done another backup here...
Then I dug a bit into the RSS feeds and saw I still had an Aggregator module running whilst I was actually using the Feeds modules. This is where it went off the rails... I also saw a "feeds" field in my Views which was empty and when I edited it, it showed an error. So after fiddling a bit I thought let's just delete that field as it showed disabled anyway. And that's where it started, as the RSS functionality promptly broke but the site was still running.
I struggled for hours to try to recreate what that field did and get the RSS feed running. By early morning I thought OK I'll have to restore that Softaculous backup. Of course halfway through the restore I got a permissions error and the whole site crashed with half written files... I also tried a partial restore from cPanel itself which restores the entire /drupal directory - it did not help but I now know because the main MySQL database thinks the Drupal database is empty and does not know about the restore.
So by 05:24 yesterday I logged a fault with my ISP to ask them to do the restore. They struggled with the same issue I had and Drupal kept prompting for a new installation. It was all due to the main database actually... the data was restoring.
Twenty fours later I was still struggling with it and by 5pm the ISP people had changed shifts already. The new guy was asking me what we had all done etc and then I thought, let me just try another Softaculous restore... in case. Wow it just restored perfectly and my site went live a few seconds later! Could be that the other restores earlier on had removed some corrupted data or permissions issue, I don't know.
But the key with cPanels and MySQL databases is to try restore via them as they update the database to recognise the restore properly. External restores puts things out of sync. Key thing also is to not only do a Softaculous backup but also from cPanel to do a database only backup. Often (especially with Drupal) you need to restore the database if the Softaculous restore fails.
So after that I had to still redo all the tweaks I did the previous evening as the backup was done before I strarted. But it's what I love doing so I kept sparking along. Good to see the Pixel 2 phone kept up with me all the way - it's the way batteries should be.
I managed to squeeze a chapter of reading in before nodding off at 00:25 on the third calendar day...