Fresh gitea install, reuse old repos

Hello all,

I had a Gitea installed and working on a VM. It was using repos over NFS. However I wanted to reinstall the VM on which Gitea was running, so I did that. I had saved my config files, and I had write a small how-to about installing Gitea.

I reinstalled the VM, and installed Gitea again. It worked perfectly, but I do not know how to import my old existing repos.

I had created the same user in Gitea as it was before. I tried creating a new repo with the same name, but I am getting error that the path already exists. I tryed searching for info, but no success.

How can I reuse my old repos, with their commits, and branches etc. with a new Gitea installation? Or maybe I should have done something before I deleted my old Gitea installation?

My backup plan is to move the existing repos on another file system, create new ones in Gitea and import the code in them, but I guess there is a better way to do that?

Best regards.

PS:
I guess this cannot be done because mysqldb is brand new, and has no records. Next time i will try to backup the DB first.

For this time, I copied the bare git repositories, made them normal git repos, then created new in Gitea, cloned them and copy/pasted the old content. This way i saved my commits and merges

Anyway… if there is better way, let me know bellow :smiley:

You could find some useful information on https://docs.gitea.io/en-us/backup-and-restore/