Making a project backup in a simple way

black and white plastic containers
Photo by Markus Winkler on Unsplash

It is 2022-07-07 today. Two days ago I’ve stupidly and accidentally lost literally all data from this server including this blog and some pet projects.

There was no regular backuping. All backups I had at the moment was dated may which is better than nothing at all. Well, either I became very tidy in my tech skills or life still teaches me nothing ¯\_(ツ)_/¯

I set up server from scratch and deployed my projects again from those backups. It took me about several hours during two days. Unfortunately, I absolutely don’t remember exactly what has been permanently lost. Shit happens.

Before that accident I didn’t bother with backups: I already have some ones, server is (almost) always stable and fine, bills are always paid in time, what may happen? This was wrong laziness.

This time I was lazy properly, as any tech guy should: if you don’t want to spend time on boring routine — automate it and don’t spend.

Since my VPS deployed without any containers-n-shit, my solution will be simple too: bash + mysqldump + gzip + rsync + crontab + second VPS as reserve remote storage.

This second you maybe already understand what I will do and talk about because our grandfathers already

At this second, you maybe already understood what I’ll do and tell and decided to close the tab, because even your grandfather didn’t do backups like that. Well, I don’t give a shit and anyway will tell my solution and attach gist which is ready to use.

Installing gitea on clean virtual server

Hi. I hope this cheatsheet will help you to install your own github-like source code storage. I really advice you to do so.

I made this using gitea’s binary file and scratch . TL;DR:

  • prepare server;
  • prepare database;
  • prepare nginx;
  • download binary executable;
  • sort out some config files;
  • install gitea;
  • configure system daemon.