# Export format for Gitea

**URL:** <https://forum.gitea.com/t/export-format-for-gitea/3845>\
**Category:** General\
**Created:** [September 29, 2021, 6:16am UTC](https://forum.gitea.com/t/export-format-for-gitea/3845 "2021-09-29T06:16:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dachary](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/dachary/32/4990_2.png) [@dachary](https://forum.gitea.com/u/dachary)\
**Post date:** [September 29, 2021, 6:16am UTC](https://forum.gitea.com/t/export-format-for-gitea/3845/1 "2021-09-29T06:16:26Z")

</div>

Bonjour,

It would be useful to have **an export format for Gitea** , similar to what [GitLab has](https://docs.gitlab.com/ee/user/project/settings/import_export.html#export-a-project-and-its-data). It could be used to import projects in other Gitea instances, as an alternative to migrating from an existing Gitea instance via the API.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/gitea/original/2X/2/2337249a93943324b538fa3ef5ebc42f54385c41.png)

The GitLab export format would be a good starting point but it is not documented which makes it unsuitable for anything but exchanging data between GitLab instances.

In the context of the [fedeproxy](https://fedeproxy.eu) project a [file format is developed](https://lab.fedeproxy.eu/fedeproxy/fedeproxy/-/tree/master/fedeproxy/format/data) and used as a pivot to exchange data between forges (issues, etc.).

![image](https://us1.discourse-cdn.com/flex020/uploads/gitea/original/2X/1/1e50ecfc1041aed309ecfa3e0dafb9d6361d7c3a.png)

It would make sense for fedeproxy and Gitea to share the effort to develop that format and I’m intend to work on this in the coming months. Unless someone think it is useless for some reason?

Cheers

---

<div class="post-metadata">

**Author:** ![dachary](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/dachary/32/4990_2.png) [@dachary](https://forum.gitea.com/u/dachary)\
**Post date:** [September 29, 2021, 6:26am UTC](https://forum.gitea.com/t/export-format-for-gitea/3845/2 "2021-09-29T06:26:31Z")

</div>

This seems to be an export/import feature. I’ll take a closer look.

> <https://github.com/go-gitea/gitea/pull/12244>
>
> Currently online migrating is possible but in fact, it depends on the internet n…etwork status what's a mess. This PR makes it possible to dump a repository on GitHub/GitLab/Gitea to a disk directory and then transfer it to another Gitea instance via the possible transfer method. And then restore the repository on the target Gitea instance.
> 
> i.e. Gitea repository itself in GitHub spent about 80 GB but transfer 80GB online is almost impossible. Then we can dump the repository to a host nearby Github's host and then compress it and transfer it to another host.
> 
> A new Gitea command has been added to do the things, you can use it as below:
> 
> \`\`\`
> ./gitea dump-repo --repo\_dir ./dumps --clone\_addr https://github.com/go-xorm/builder.git --auth\_username \<token\> --owner\_name xorm --repo\_name builder
> \`\`\`
> 
> A dumped repository(go-gitea/test\_repo) directory structure like this.
> 
> \<img width="375" alt="图片" src="https://user-images.githubusercontent.com/81045/87848041-20310f80-c90f-11ea-9fdd-7c8ca98f4450.png"\>
> 
> Another command is \`restore-repo\` added from this PR which could restore the repository to a Gitea instance from the dumped folder.
> 
> \`\`\`
> ./gitea restore-repo --repo\_dir ./dumps/xorm/builder --owner\_name xorm --repo\_name builder
> \`\`\`
> 
> And this could be also used as a backup tool to backup repositories in Github/Gitlab/Gitea .
> 
> \- \[x\] Add a command \`gitea dump-repo\`
> \- \[x\] Add a command \`gitea restore-repo\`

**Update** it dumps the result of a migration into YAML files that reflect the content of the database. These YAML files can then be imported, as if they were the result of the migration. This is a possible starting point for a format, even though it is currently undocumented and therefore internal only.

---

<div class="post-metadata">

**Author:** ![techknowlogick](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/techknowlogick/32/4706_2.png) [@techknowlogick](https://forum.gitea.com/u/techknowlogick)\
**Post date:** [September 30, 2021, 2:50am UTC](https://forum.gitea.com/t/export-format-for-gitea/3845/3 "2021-09-30T02:50:35Z")

</div>

yes, what you’ve found is indeed the export/import machine readable format. It is how we are migrating away from github. As what we do is export from github to disk, the import into gitea. The two step process is to keep the steps close to servers for best network performance (although for repos that don’t have 17k+ issues/PRs, the web based migration is more than suitable).

---

<div class="post-metadata">

**Author:** ![lunny](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/lunny/32/4701_2.png) [@lunny](https://forum.gitea.com/u/lunny)\
**Post date:** [October 11, 2021, 11:43am UTC](https://forum.gitea.com/t/export-format-for-gitea/3845/4 "2021-10-11T11:43:24Z")

</div>

Currently, it’s a private format. But I wish someday we can make it as a standard.
