Issue Importing via API

I’m trying to move a repo from one organization to another for an established code base. The code was moved no problem, but as we all know moving the Issues is way more of a hassle than it should be. The CSV export only gives limited fields which causes tremendous history loss. I was able to use the API and perform a GET “…/api/v4/issues” to pull down a much better version into a JSON file.

However, there doesn’t seem to be a way to use the API to perform a PUT or a POST to upload this json file into the new repo. Has anyone figured this out yet? TIA

It’s not quite clear whether you’re trying to move a repo between different GitLab instances, or the versions involved, but here are some pointers:

Within the same GitLab instance you can:

  • Transfer an entire project to another namespace (Docs | API docs)
  • Directly move issues between projects (API docs)

Between different instances, including gitlab.com <> self-managed, you can:

  • Migrate groups and projects by direct transfer (Docs | API docs)
    • You probably want to be on v15.10+ to use this, YMMV - check the version history on the linked pages, migrating projects is officially still in beta
  • Otherwise using file export should be an option (Docs | API docs)

You can find a similar summary of the different options on this page.

If you really want to / have to import based on the JSON that you pulled down, then you’ll have to iterate over the entries and use the new issue endpoint.

Thanks this is very helpful!
It’s between different GitLab instances, neither are on gitlab.com. Both are docker images running on different AWS servers.

Unfortunately, I don’t have permissions to run the export on the original side. So I’ve had to clone the repo locally then push it to the new instance.