Rising from the Ashes: Restoring Inovus Blogs Post-Termination
Tags: webdev, devops, aws, opensource
Published: 2023-11-05 07:55:46

> _Here's how we managed to recover the contents of a blog hosted on an AWS EC2 instance after being wrongfully terminated._

---

In the world of blogging, setbacks and challenges are bound to occur. But what happens when a setback is not just a hurdle but a full-blown wrongful termination that leaves you with nothing but ashes?

## The Ascent and Unforeseen Halt
**[Inovus Blogs](https://blog.inovuslabs.org/)** is more than just a blog; it is our creative outlet, a platform to express our thoughts, and a place to engage with a community of like-minded individuals. To be specific, (really happy to say) it turned out to be exactly what it was supposed to be when the initial ideas of the same were conceived.

The blog was hosted on an AWS EC2 instance, utilizing its generous 12-month free tier. Even though I was skeptical about the 1-vCPU & 1 GiB RAM config of the t2-micro instance, with the generous [750 EC2 hours](https://aws.amazon.com/ec2) every month, free [Elastic IP](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html), and a whopping [30GB Elastic Block Storage](https://aws.amazon.com/ebs/), we were good to go.

The Ghost CMS was our ultimate platform of choice and on 17th Jan 2023, Inovus Blogs was finally launched. Since then, 25+ blogs were written on a diverse range of topics. The Google Analytics dashboard too was showing really promising data.

![Screenshot from our Google Analytics Dashboard](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/41d2kiv3mfvz7jtqxtz1.png)

On 20th May 2023, we started experiencing an issue with CPU Utilization of our EC2 Instance directly throttling to the max 100%, and crashing itself just like a stinger honeybee. As this self-throttling issue seems to appear often, I added [AWS Cloudwatch](https://aws.amazon.com/cloudwatch/
) actions to <u>monitor the server</u>, <u>send an Alarm</u> when the CPU utilization exceeds a predefined threshold, and <u>restart the server</u> automatically.

![Screenshot of AWS EC2 Restart Alarms from AWS Cloudwatch](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7jzpkpwr3jyifmu2yc4b.png)

Since then I've received close to 80 Alarms, which means... Shit happened... As the Cloudwatch Actions worked really well, we never went totally down for more than 4-5 minutes. But as we all know, nothing lasts forever.

The evening of 28th October 2023 was a delicate little thing until I happened to notice that, Inovus Blogs just went offline. At first glance, I thought of it as the CPU throttling issue, that I mentioned before. But I literally got shivers down my spine when I came to realize that, the instance just got **TERMINATED** (not **STOPPED**) - which means our blog just vanished into thin air, with literally no backup of the database & media uploaded alongside the blogs.

## The Path to Recovery: Phoenix arises
The mission was to recover this very blog to the way it was before ASAP. I'm not here to walk you through the step-by-step processes of deploying a Ghost blog. There are plenty of blogs and videos out there that lecture every step in detail, in a much simpler manner. Rather I would like to emphasize more on, how I recovered most of the data on a website that was deleted from the web entirely.

### Internet Archive (Wayback Machine)
**Internet Archive** is a non-profit library of millions of free books, movies, software, music, websites, and more. As per Wikipedia, The **Wayback Machine** is a digital archive of the World Wide Web founded by the Internet Archive. Created in 1996 and launched to the public in 2001, it allows the user to go "back in time" to see how websites looked in the past. It has already saved more than 858 Billion web pages over time.

As per the [Wayback Machine Search](**https://web.archive.org/web/20230000000000*/https://blog.inovuslabs.org/**), our blog has been saved 8 times in the past, and the last entry was on June 25, 2023. There's no guarantee in the amount of data that you might find up there or the frequency in which they would capture a web page (totally random, I suppose). Half of the available data (blogs) were in good shape. But the story for the other half were'nt. Anyway, _"Half a loaf is better than none", right..._

![Web page cache from Wayback Machine](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o1amkoxd6pj8s5bacabz.png)

For the new deployment, we prefer to have a [DigitalOcean Droplet](https://www.digitalocean.com/products/droplets) rather than an AWS EC2 Instance. I created a new droplet, configured Ghost, and started copy-pasting the blogs one by one. For the blogs with corrupted data & assets and the blogs published after June 25, 2023, we'll have to depend on something else.

### Google Search Cache
Google Cache is normally referred as the copies of the web pages cached by Google. Google crawls the web and takes snapshots of each page as a backup just in case the current page is not available. These pages then become part of Google's cache.

Here's how you can [view web pages cached in Google Search Results](https://support.google.com/websearch/answer/1687222?hl=en). The `site : search operator` would also help you filter the website URL. You can also use the `cache : search operator` to find the cached version of a page.

![Screenshot of a web page from Browser Web Cache](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cm8o9jlh5qxibq9d1wu8.png)

## The Lessons Learned
Protecting your website from wrongful termination or unexpected shutdowns is crucial, as it ensures the continuity of your online presence and prevents the loss of valuable content. Here are some steps you can take to safeguard your website:

- <u>**Read and Understand the Terms of Service:**</u>
Carefully review the terms of service (TOS) of your hosting provider. Ensure that you understand what is allowed and what isn't, as violating these terms can lead to wrongful termination.

- **<u>Regular Backups:</u>**
Frequently back up your website and its data. Choose automated backup solutions if available, and store backups in multiple locations, including off-site and in the cloud.

- **<u>Stay In Compliance:</u>**
Continuously monitor your website's activities to ensure compliance with the hosting provider's terms of service and relevant laws.

- **<u>Monitor Server Status and Uptime:</u>**
Use server monitoring tools to keep an eye on your website's uptime and performance. This can help you identify issues before they become critical.

- **<u>Implement a Disaster Recovery Plan:</u>**
Develop a disaster recovery plan that outlines the steps to take if your website is wrongfully terminated.
Consider a Secondary Hosting Provider:
Diversify your hosting setup. Having a secondary hosting provider can serve as a backup plan in case your primary hosting provider terminates your services.

- **<u>Stay Informed:</u>**
Keep yourself informed about industry best practices, changes in regulations, and updates in hosting provider policies that could affect your website.

Remember that while these steps can help mitigate the risk of wrongful termination, there is no foolproof way to guarantee it won't happen. However, by being proactive and prepared, you can reduce the chances of your website being unjustly shut down and increase your ability to recover swiftly if it does occur.

## Conclusion
The wrongful termination that could have spelled the end for Inovus Blogs instead became the catalyst for its rebirth. Rising from the ashes was no easy feat, but it reaffirmed our commitment to the platform and the importance of the content we create. In the end, it was not just about rebuilding a website; it was about preserving our voice, our ideas, and our passion for sharing knowledge with the world.