# Move repository

**URL:** https://forum.gitea.com/t/move-repository/8758
**Category:** Install/Maintain/Configure
**Created:** [March 13, 2024, 12:16pm UTC](https://forum.gitea.com/t/move-repository/8758 "2024-03-13T12:16:54Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![zisco67](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/zisco67/32/4491_2.png) [@zisco67](https://forum.gitea.com/u/zisco67)
#### Post date: [March 13, 2024, 12:16pm UTC](https://forum.gitea.com/t/move-repository/8758/1 "2024-03-13T12:16:54Z")

</div>

I want to move my repo from

```auto
[repository]
ROOT = /home/git/gitea-repositories

```

to a mount point like  
`ROOT = /var/lib/gitea`

What do I have to do? Stop the service, change app.ini and start the service?

THX

---

<div class="post-metadata">

### Author: ![mlebon](https://avatars.discourse-cdn.com/v4/letter/m/3ab097/32.png) [@mlebon](https://forum.gitea.com/u/mlebon)
#### Post date: [March 13, 2024, 1:16pm UTC](https://forum.gitea.com/t/move-repository/8758/2 "2024-03-13T13:16:57Z")

</div>

You need to modify environment variable in service file systemd/gitea.service  
WorkingDirectory and GITEA\_WORK\_DIR

systemctl daemon-reload  
systemctl restart gitea

systemctl status gitea

you can check yous configuration with  
sudo -H -u git bash -c ‘/usr/local/bin/gitea --config /etc/gitea/app.ini doctor check’

---

<div class="post-metadata">

### Author: ![zisco67](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/zisco67/32/4491_2.png) [@zisco67](https://forum.gitea.com/u/zisco67)
#### Post date: [March 14, 2024, 8:42am UTC](https://forum.gitea.com/t/move-repository/8758/3 "2024-03-14T08:42:17Z")

</div>

I’m running gitea in a proxmox LXC:

```auto
root@GitLab .../systemd/system# systemctl status gitea
* gitea.service - Gitea (Git with a cup of tea)
     Loaded: loaded (/etc/systemd/system/gitea.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2024-02-13 14:15:19 UTC; 4 weeks 1 days ago
   Main PID: 1102 (gitea)
      Tasks: 10 (limit: 9308)
     Memory: 96.7M
        CPU: 18min 46.909s
     CGroup: /system.slice/gitea.service
             `-1102 /home/git/gitea web -c /etc/gitea/app.ini

```

There is no GITEA\_WORK\_DIR environment-variable…

---

<div class="post-metadata">

### Author: ![mlebon](https://avatars.discourse-cdn.com/v4/letter/m/3ab097/32.png) [@mlebon](https://forum.gitea.com/u/mlebon)
#### Post date: [March 14, 2024, 10:05am UTC](https://forum.gitea.com/t/move-repository/8758/4 "2024-03-14T10:05:08Z")

</div>

Good morning,  
poor understanding of the expected, I thought you wanted to modify the work path  
app.ini [gitea/custom/conf/app.example.ini at main · go-gitea/gitea · GitHub](https://github.com/go-gitea/gitea/blob/main/custom/conf/app.example.ini)

```auto
;; The working directory, see the comment of AppWorkPath above
;WORK_PATH =

```

and in this case then you should have modified the variables in the file /etc/systemd/system/gitea.service

I would like to be sure I understand,  
If we follow the Gitea documentation ([Installation from binary | Gitea Documentation](https://docs.gitea.com/installation/install-from-binary#create-required-directory-structure)),  
mkdir -p /var/lib/gitea/{custom,data,log}

you should have something that looks like this

```auto
/var/lib/gitea/data/gitea-repositories
/var/lib/gitea/data/packages
/var/lib/gitea/data/repo-archive

```

If you want to move gitea-repositories to another location  
then you are right,

```auto
;[repository]
;; Root path for storing all repository data. By default, it is set to %(APP_DATA_PATH)s/gitea-repositories.
;; A relative path is interpreted as _`AppWorkPath`_/%(ROOT)s
;ROOT =

```

---

<div class="post-metadata">

### Author: ![zisco67](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/zisco67/32/4491_2.png) [@zisco67](https://forum.gitea.com/u/zisco67)
#### Post date: [March 14, 2024, 2:49pm UTC](https://forum.gitea.com/t/move-repository/8758/5 "2024-03-14T14:49:45Z")

</div>

THX and sorry for asking again: Changing the path forces a move of existing repositories? Or do I have to move them manually?

---

<div class="post-metadata">

### Author: ![p7k](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/p7k/32/4234_2.png) [@p7k](https://forum.gitea.com/u/p7k)
#### Post date: [March 15, 2024, 8:03am UTC](https://forum.gitea.com/t/move-repository/8758/6 "2024-03-15T08:03:01Z")

</div>

Gitea itself does not move any data. As soon as you have changed the repo path, Gitea no longer recognizes the old path. You must therefore move the data yourself. From the workflow: 1. stop Gitea. 2. move the data. 3. change the path in the configuration. 4. start Gitea.

---

<div class="post-metadata">

### Author: ![zisco67](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/zisco67/32/4491_2.png) [@zisco67](https://forum.gitea.com/u/zisco67)
#### Post date: [March 15, 2024, 3:09pm UTC](https://forum.gitea.com/t/move-repository/8758/7 "2024-03-15T15:09:43Z")

</div>

Thanks a lot! Now it was an easy job!  
There is no UI where I can see which repository root is used?

---

<div class="post-metadata">

### Author: ![delvh](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/delvh/32/5047_2.png) [@delvh](https://forum.gitea.com/u/delvh)
#### Post date: [March 15, 2024, 3:14pm UTC](https://forum.gitea.com/t/move-repository/8758/8 "2024-03-15T15:14:26Z")

</div>

Exactly the censored lines show you what Gitea knows:

 ![grafik](https://us1.discourse-cdn.com/flex020/uploads/gitea/original/2X/0/0d7b631cb8fcb1099a18a5d13c49d11df0ca4d75.png)
