# Migrate from git to gitea

**URL:** <https://forum.gitea.com/t/migrate-from-git-to-gitea/2035>\
**Category:** Install/Maintain/Configure\
**Created:** [March 26, 2020, 1:22pm UTC](https://forum.gitea.com/t/migrate-from-git-to-gitea/2035 "2020-03-26T13:22:31Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![OneMorewillnotkillme](https://avatars.discourse-cdn.com/v4/letter/o/7ba0ec/32.png) [@OneMorewillnotkillme](https://forum.gitea.com/u/OneMorewillnotkillme)\
**Post date:** [March 26, 2020, 1:22pm UTC](https://forum.gitea.com/t/migrate-from-git-to-gitea/2035/1 "2020-03-26T13:22:31Z")

</div>

Hi I am new to Gitea.  
I am trying to migrate my old git repo’s to Gitea I only used the command line and git bash never a web git Application like gitea.  
I tried to migrate my nagios repo that I have on the same server into gitea but it dosn’t work and everywhere I look I only find migration between Github and Gitea.  
Can somebody help me with that?

---

<div class="post-metadata">

**Author:** ![jolheiser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/jolheiser/32/4807_2.png) [@jolheiser](https://forum.gitea.com/u/jolheiser)\
**Post date:** [March 26, 2020, 1:34pm UTC](https://forum.gitea.com/t/migrate-from-git-to-gitea/2035/2 "2020-03-26T13:34:51Z")

</div>

You have a few options here.

1. You can set `IMPORT_LOCAL_PATHS` to `true` in the `[security]` section of your app.ini and then migrate them from a local path.  
[Link to docs for `IMPORT_LOCAL_PATHS`](https://docs.gitea.io/en-us/config-cheat-sheet/#security-security)
2. You can set Gitea as a new remote from a checked out repository and then push.  
`git remote add gitea https://my.gitea/user/repo.git` and `git push gitea --all && git push gitea --tags`

If you do the latter, you can either create the repo first in the web UI, or enable push-to-create, in which Gitea will create non-existent repositories for you when you first push to them.  
[Link to docs for `ENABLE_PUSH_CREATE_USER`](https://docs.gitea.io/en-us/config-cheat-sheet/#repository-repository)

---

<div class="post-metadata">

**Author:** ![HappyFrog](https://avatars.discourse-cdn.com/v4/letter/h/f14d63/32.png) [@HappyFrog](https://forum.gitea.com/u/HappyFrog)\
**Post date:** [December 4, 2023, 1:27pm UTC](https://forum.gitea.com/t/migrate-from-git-to-gitea/2035/3 "2023-12-04T13:27:43Z")

</div>

I’ve set the `IMPORT_LOCAL_PATHS` to true and restarted Gitea service.  
Now, how the migration can be done, please?

---

<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:** [December 11, 2023, 7:21am UTC](https://forum.gitea.com/t/migrate-from-git-to-gitea/2035/4 "2023-12-11T07:21:49Z")

</div>

I think you can just input the repository path on the server into the box and click import?

---

<div class="post-metadata">

**Author:** ![HappyFrog](https://avatars.discourse-cdn.com/v4/letter/h/f14d63/32.png) [@HappyFrog](https://forum.gitea.com/u/HappyFrog)\
**Post date:** [August 26, 2024, 9:57am UTC](https://forum.gitea.com/t/migrate-from-git-to-gitea/2035/5 "2024-08-26T09:57:36Z")

</div>

Hello lunny,

you are right.

app.ini:

…  
ALLOWED\_DOMAINS =  
ALLOW\_LOCALNETWORKS = true  
…

Migrate / Clone From URL: git://czjih1lgit1.mmemea.marelliad.net:/var/git/psr.git  
Username and password: Correct, checked several times.

When I click “Migrate Repository” buttn, I receive this error: You cannot import from disallowed hosts, please ask the admin to check ALLOWED\_DOMAINS/ALLOW\_LOCALNETWORKS/BLOCKED\_DOMAINS settings.

Both, source git server and the gitea server are in the same subnet.

---

<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:** [August 31, 2024, 3:28am UTC](https://forum.gitea.com/t/migrate-from-git-to-gitea/2035/6 "2024-08-31T03:28:17Z")

</div>

Because you are using a domain as remote site. It has been consider as a domain system but not a local network. So you need to add `czjih1lgit1.mmemea.marelliad.net` to your `ALLOWED_DOMAINS =`.

---

<div class="post-metadata">

**Author:** ![HappyFrog](https://avatars.discourse-cdn.com/v4/letter/h/f14d63/32.png) [@HappyFrog](https://forum.gitea.com/u/HappyFrog)\
**Post date:** [August 31, 2024, 2:05pm UTC](https://forum.gitea.com/t/migrate-from-git-to-gitea/2035/7 "2024-08-31T14:05:27Z")

</div>

Hello lunny,

thanks for your support.  
I’ve solved ‘migration from git to gitea’ problem already by configuration change and installing git-daemon-dun on my Debian box.  
More information can be found here: [Migrate repository Gitea to another Gitea server - #7 by HappyFrog](https://forum.gitea.com/t/migrate-repository-gitea-to-another-gitea-server/8761/7)

---

<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:** [September 1, 2024, 6:37pm UTC](https://forum.gitea.com/t/migrate-from-git-to-gitea/2035/8 "2024-09-01T18:37:29Z")

</div>


