I had a FreeNAS server system with a Gogs system in a jail. Through some “upgrade madness” I upgraded this to TrueNAS and past the point where the original style of jails was supported. As a result I am left with a complete (but non-functional) installation of Gogs (including all of my repositories)
In moving forward I decided to go ahead with a Gitea installation. I am now at the point where I want to migrate the old Gogs data to the new Gitea system, but I have no idea how best to do this.
I saw the Upgrade from Gogs page, but the first step in this is to run “gogs backup”, and I don’t have a functional system to do that with. It also looks like the instructions suggest starting a migration to Gitea 1.0 and then upgrading Gitea, but I am already on Gitea 1.12
I thought that this other question (Using pre-existing local bare repositories? ) might help, but I can’t seem to follow exactly what is proposed (or if it actually helps in my situation).
So how should I proceed?
I moved a small Gogs installation to Gitea.
I wrote a SQL script to do this, and also copied the git repos.
It involves a new Gitea installation rather than an existing one (with data etc.), but may give you ideas.
When you get to my project, have a look through the readme.
It is listed on awesome-gitea in the migration section.
Just noticed info re 1.13
My script etc was based on Gitea 1.12, so perhaps
- get data from Gogs into Gitea 1.12
- upgrade Gitea from 1.12 to 1.13
- use “adopt repositories” for repos that were not in Gogs
See 1.13 blog
Adopt repositories ([#12920])
Administrators can now adopt repositories that are on disk, but not yet in Gitea’s database.
An administrator can also allow users to adopt repositories from their settings.
Thanks to [ @zeripath ]
I have almost completely succeeded with my migration. What I did was:
- Created a FreeBSD virtual machine and installed Gogs
- Copied the configuration from my old Gogs system to the VM
- Verified that I could access everything, and that no data was missing
- Played with the gogs.db and the gitea.db to see what the differences were
- Reset my Gitea.db
- Copied the complete git directory structure from the Gogs system to the equivelent Gitea location. Then set the user and group id’s of every file to match the Gitea account
- Created my Gitea username through the Gitea website
- Using the Gitea website, created repositories in Gitea in the same order and with the same names as they were in Gogs, so that the repository id was the same.
- Exported the action table from Gogs and sliced it up so that it matched the Gitea format (and there was very little in the way of changes to be made)
- Overwrote the contents of the action table in Gitea with the exported data
- Exported the unix time stamps and repository sizes from the Gogs repository table and updated the values in the Gitea db
- Updated the is_empty field in the Gitea repository table to zero
This gets me access to all of my data via Gitea!! I’m a happy camper now.
There are two tables in Gitea that I am not sure how to populate:
I basically understand what is meant to go into each table, but is there a way to get Gitea to fill in the details for me?