Gitea is a self-hosted Git service that allows users to host their Git repositories on their own servers. It is a lightweight and easy-to-use platform that provides many of the same features as other Git hosting services, such as GitHub and GitLab. Gitea is open-source and can be installed on a variety of platforms, making it a popular option for those who want complete control over their Git repositories. In this post, we'll show you how to back up your Gitea data using SimpleBackups, a cloud-based backup service that can help you protect your code and ensure that your team can keep working even when things go wrong.
However, things can go wrong. And, sometimes, they will. In these situations, you’ll need backups of your Gitea data to ensure that you have access to your code and that your team can keep working.
In this post, we’ll show you how to back up your Gitea data with SimpleBackups.
Before looking at the backup process in more detail, let’s first look at what data you should back up. Ideally, to ensure your data is properly protected, you should back up all your repositories, including their related metadata.
This means you should back up:
Apart from backing up these, you should also consider your needs and requirements, and schedule your backups to meet these needs. Combined, this will ensure you have the complete data available should disaster strike.
Before you can back up your data with Gitea, you’ll need to create a personal access token that you’ll use to connect Gitea to SimpleBackups. These tokens allow you to access your Gitea resources when using the Gitea API or command line.
Currently, Gitea supports two types of personal access tokens - API tokens and SSH keys.
Note: SimpleBackups currently supports the API token.
To create an API token, you can follow the steps provided by us here.
Once you’re done, you should copy the token to use later to set up the connection with SimpleBackups.
Now that your token is saved, you can create your backup on SimpleBackups by configuring a Gitea recipe.
To do this, you’ll first log into your SimpleBackups account.
To create your backup is to click on Backups in the top menu.
On the page that opens, click on Create Backup +.
Once done, you’ll get to the same screen you would have had you used the first method.
Here, it’s essential to ensure that both the Recipe and Gitea Backup tiles are selected.
For the next step, you’ll need to configure your backup recipe.
Here, you’ll paste the token you generated earlier and enter your Gitea username, and hostname.
You’ll also select several options based on your unique circumstances:
Whether the backup is for a private or organizational account. When you select the private account option, the backup will also include private repositories.
You can also select which repositories you’d like to back up. You can choose between Starred Repos, Watched Repos, and Forked Repos. You can also choose to back up a specific repo.
Finally, you can also choose what you’d like to back up. Based on your needs, you can run full backups, or back up only issues, pulls, wikis, gists, releases, or assets.
In this example, we’ve pasted the token into the relevant text box, entered our Gitea username and hostname, and selected to perform a full backup of a specific repository.
For the next step, you’ll need to choose the server that will run the backup. You have two options:
Serverless. This option allows you to run the backup on SimpleBackups’ infrastructure and store your backups off-site. There is no setup required, and you’ll save on resources.
Own Server. As the name implies, this option allows you to run the backup using your own infrastructure. This option will enable you to store your backups off-site, locally, or on mounted volumes.
In this example, we’ll use the Own server option. So, we’ll make sure that the correct tile is selected.
You can then click Validate to confirm the connection.
The final step, after you’ve validated the connection, is to choose:
Your storage. Choose one of several options, including Amazon S3, DigitalOcean Spaces, Google Cloud Storage, and more. In this example, we’ll use the same Dropbox we used in an earlier post.
Retention schedule. Set your retention schedule to determine how long you’ll keep your backups. Earlier backups will be deleted once the maximum is reached.
Backup frequency. Choose daily, weekly, monthly, on-demand, or even create a custom backup schedule based on your needs and requirements. In this example, we’ll use daily backups.
There you go; now you know how easy it is to back up your Gitea data with SimpleBackups!
But why should you use SimpleBackups?
Well, for one, when using SimpleBackups, you can connect almost any storage you’d prefer. You’ll be in complete control of your data and won't depend on the SimpleBackups platform to recover your data.
When using the platform, you’ll have access to the SimpleBackups notification system. This, in turn, gives you access to email and Slack notifications, task summaries, and even advanced audit logs relating to your backups. You’ll never be in the dark about your Gitea backups.
To learn more about SimpleBackups, our range of innovative features, and how our platform can help you, get started for free today.
Free 7-day trial. No credit card required.
Have a question? Need help getting started?
Get in touch via chat or at [email protected]