Skip to content

Instantly share code, notes, and snippets.

@palaniraja
Last active April 26, 2026 03:54
Show Gist options
  • Select an option

  • Save palaniraja/30dc9e89dfabb6e8e5825ee34c679141 to your computer and use it in GitHub Desktop.

Select an option

Save palaniraja/30dc9e89dfabb6e8e5825ee34c679141 to your computer and use it in GitHub Desktop.
Migrating self-hosted Gogs instance to self-hosted Forgejo

After several failed attempts to use other's scripts, I stumbled upon the following option. Worked alright for 40+ of my repos, YMMV

Migrating gogs to forgejo

  • backup gogs repo with gogs backup

    • docker exec -it gogs_container_name
    • bash8698765c2e8a:/app/gogs# USER=git ./gogs backup
  • copy the file and unzip the gogs-backup.zip

  • extract gogs-backup/repositories.zip (has all the bare repos)

  • copy them to forgejo's container /data/git/repositories/<username>

    • you may also want to run chown -R 1000:1000 /data/git/repositories/<username> post copy based on your setup
  • from forge's admin panel url/admin/repos (admin settings -> code-assets -> repositories)

    • search by username
    • unadapted repositories
    • adopt each of those repos

    optional remapping of self signed gogs url to new forejo's

To map old url post upgrade, set conf/gitea/app.ini ROOT_URL to old-gogs.selfhosted.com (old url)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment