<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/forgejo-hack-how-to-set-a-starting-issue-and-pull-request-number-fpkiqfmw7" -->

---
title: Forgejo hack: How to set a starting issue and pull...
description: A workaround shows how to set a custom starting number for issues and pull requests in a self-hosted Forgejo instance, useful when migrating from GitHub and...
canonical: https://daily.dev/posts/forgejo-hack-how-to-set-a-starting-issue-and-pull-request-number-fpkiqfmw7
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Forgejo hack: How to set a starting issue and pull request number | daily.dev
og:description: A workaround shows how to set a custom starting number for issues and pull requests in a self-hosted Forgejo instance, useful when migrating from GitHub and...
og:url: https://daily.dev/posts/forgejo-hack-how-to-set-a-starting-issue-and-pull-request-number-fpkiqfmw7
og:image: https://api.daily.dev/og/posts/fPKIQfmW7.png
og:image:alt: Forgejo hack: How to set a starting issue and pull request number
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Forgejo hack: How to set a starting issue and pull request number

**[Miguel Grinberg](https://daily.dev/sources/miguelgrinberg)** · 3 min read · 0 upvotes · 0 comments

## Summary

A workaround shows how to set a custom starting number for issues and pull requests in a self-hosted Forgejo instance, useful when migrating from GitHub and wanting to avoid number collisions between old GitHub issues and new Forgejo ones. Since there's no UI or config option for this, the fix involves directly modifying the issue_index table in the underlying database, either globally or per-repository using the repository's id. Verified on Postgres with Forgejo version 15; expected to work similarly on MySQL or SQLite though untested.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://blog.miguelgrinberg.com/post/forgejo-hack-how-to-set-a-starting-issue-and-pull-request-number>

## Questions this post answers

### How can I set a custom starting issue or pull request number in Forgejo?

Update the max_index column in the issue_index table directly in the database, since there is no configuration option for this. Running `update issue_index set max_index=10000;` makes the next issue or pull request created in every repository start at #10001. This works for a Postgres-backed Forgejo instance, version 15.

_Migrating GitHub issues to Forgejo without number clashes is exactly the kind of workflow tip daily.dev surfaces for self-hosters._

### How do I set the starting issue number for just one repository in Forgejo?

First find the repository's database id by running `select id, name from repository;`. Then update only that repository's counter with `update issue_index set max_index=10000 where group_id=123;`, substituting the actual id. Choose a number higher than any existing issue or pull request in that repository to avoid duplicate numbers.

_Developers self-hosting Forgejo can keep tabs on hacks like this through daily.dev while managing repository migrations._

## Similar posts on daily.dev

- [Forgejo v16.0 is available](https://daily.dev/posts/forgejo-v16-0-is-available-vslb3fjkg) · Lobsters · 1 upvotes · 0 comments
- [Issue fields are now generally available](https://daily.dev/posts/issue-fields-are-now-generally-available-x7kzvvtz9) · GitHub Changelog · 0 upvotes · 0 comments
- [Why users cannot create Issues directly · Issue \#3558 · ghostty-org/ghostty](https://daily.dev/posts/why-users-cannot-create-issues-directly-issue-3558-ghostty-org-ghostty-sgcdlhiqa) · Hacker News · 0 upvotes · 0 comments
- [Improved onboarding flow for GitHub Projects](https://daily.dev/posts/improved-onboarding-flow-for-github-projects-fcdgj5bh1) · GitHub Changelog · 0 upvotes · 0 comments
- [Release information in issue sidebar and default values for project fields](https://daily.dev/posts/release-information-in-issue-sidebar-and-default-values-for-project-fields-sd9xqpq32) · GitHub Changelog · 0 upvotes · 0 comments

---

Tags: [#database](https://daily.dev/tags/database), [#self-hosting](https://daily.dev/tags/self-hosting), [#forgejo](https://daily.dev/tags/forgejo)

[View this post on daily.dev](https://daily.dev/posts/forgejo-hack-how-to-set-a-starting-issue-and-pull-request-number-fpkiqfmw7)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Forgejo hack: How to set a starting issue and pull request number","url":"https://daily.dev/posts/forgejo-hack-how-to-set-a-starting-issue-and-pull-request-number-fpkiqfmw7","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/forgejo-hack-how-to-set-a-starting-issue-and-pull-request-number-fpkiqfmw7"},"datePublished":"2026-08-25T13:39:07.739Z","dateModified":"2026-09-13T18:33:24.838Z","description":"A workaround shows how to set a custom starting number for issues and pull requests in a self-hosted Forgejo instance, useful when migrating from GitHub and...","image":"https://media.daily.dev/image/upload/s--0_ODbtD2--/f_auto/v1722860399/public/Placeholder%2008","thumbnailUrl":"https://media.daily.dev/image/upload/s--0_ODbtD2--/f_auto/v1722860399/public/Placeholder%2008","isAccessibleForFree":true,"articleSection":"Miguel Grinberg","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Miguel Grinberg","logo":"https://media.daily.dev/image/upload/s--1lzsuTn2--/f_auto,q_auto/v1777800749/logos/miguelgrinberg?_a=BAMAMiWQ0","url":"https://daily.dev/sources/miguelgrinberg"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/forgejo-hack-how-to-set-a-starting-issue-and-pull-request-number-fpkiqfmw7","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"database,self-hosting,forgejo","timeRequired":"PT3M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Miguel Grinberg","item":"https://daily.dev/sources/miguelgrinberg"},{"@type":"ListItem","position":3,"name":"Forgejo hack: How to set a starting issue and pull request number"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/forgejo-hack-how-to-set-a-starting-issue-and-pull-request-number-fpkiqfmw7#faq","mainEntity":[{"@type":"Question","name":"How can I set a custom starting issue or pull request number in Forgejo?","acceptedAnswer":{"@type":"Answer","text":"Update the max_index column in the issue_index table directly in the database, since there is no configuration option for this. Running `update issue_index set max_index=10000;` makes the next issue or pull request created in every repository start at #10001. This works for a Postgres-backed Forgejo instance, version 15. Migrating GitHub issues to Forgejo without number clashes is exactly the kind of workflow tip daily.dev surfaces for self-hosters."}},{"@type":"Question","name":"How do I set the starting issue number for just one repository in Forgejo?","acceptedAnswer":{"@type":"Answer","text":"First find the repository's database id by running `select id, name from repository;`. Then update only that repository's counter with `update issue_index set max_index=10000 where group_id=123;`, substituting the actual id. Choose a number higher than any existing issue or pull request in that repository to avoid duplicate numbers. Developers self-hosting Forgejo can keep tabs on hacks like this through daily.dev while managing repository migrations."}}]}
```

