Many developers have a personal blog on Hashnode, one of the most popular blogging communities for people exploring tech.
I also write on Hashnode, but recently I was thinking about whether there is any way to backup my published articles to GitHub. Fortunately, I have found an easy way to do that directly from Hashnode itself.
So, in this article, I will share the process so that you can also create an automatic backup of your articles to your GitHub repository. There's no harm in trying something new, right? 😊
✨ I have also created a full length video showing the process of creating that automatic backup to your GitHub repo. I have attached the video later in this article. You can also check that out.
Firstly, let me show you my Hashnode account. This is just a sample of a typical profile there.
I have published only one article (as of today, 15 May 2022). But I still want to create an automatic backup process for this account so that whenever I write something new, all of the articles get copied into my selected GitHub repository as a backup.
So let's do that, shall we? 😁
How to Backup Your Hashnode Articles to GitHub
Go to your GitHub account. We need to create a special repository first where we will create an automatic backup process.
Now simply click on the
+ button on the top right of the webpage.
Now click New repository.
Now we have to create a new repository. The process is similar to creating any other repository.
You can make the repository Public or Private as you see fit for yourself. I am making it a Private repository, but you do not have to do that if you don't want to.
Give the repository any name you want.
For the latter, you can select anything you want. For this article, I am keeping it simple as it was.
Then click Create repository.
After that, you actually do not need to do anything in that repository for now.
So, I am keeping it as it is right now.
Now, head over to your Hashnode account.
Click your profile icon on the top right of the profile page.
Select the blog you want to backup. For me, it is https://fahimbinamin.hashnode.dev/.
Click Blog Dashboard.
The blog dashboard will appear before you.
Simply scroll down until you find Backup. You will find that on the lower left side of the webpage. Click on that.
You will find the GitHub Backup page now.
Click on Back up all my posts.
Select where you want to install it.
As I am involved in 5 GitHub organizations right now, it's suggesting all of them to me. As I want to create the backup on my personal GitHub account, I will select my profile FahimFBA.
The install and authorize section will appear.
By default, it will select "All repositories". But keep in mind, that you shouldn't select All repositories, as that will rewrite all of the repositories you currently have in your personal GitHub account.
Select "Only select repositories", and find the repository which you have created for backing up your Hashnode blogs.
Simply click and select the repository.
If everything is okay, then you can click "Install & Authorize", but again keep in mind that you must not select All repositories.
Provide your GitHub account's password if it asks for that.
If will redirect you to Hashnode to continue the installation process.
You've now created your automatic backup. If you want to back up the existing posts, then you have to click "Back up all my posts".
It will backup every post you had before creating the automatic backup.
Now, if you simply refresh the GitHub repo webpage (the repo you created only for backing up this Hashnode blog), you will see that it has been updated as well!
You can even read the article directly from your backed up repo.
If you want to watch a video that covers the whole process, then you can check out the following video that I made:
Thanks for reading the entire article. If it helps you then you can also check out other articles of mine at freeCodeCamp.
You can also SUBSCRIBE to my YouTube channel (Code With FahimFBA) if you want to learn various kinds of programming languages with a lot of practical examples regularly.
If you want to check out my highlights, then you can do so at my Polywork timeline.
You can also visit my website to learn more about me and what I'm working on.
Thanks a bunch!