# Cannot backup gitea

**URL:** <https://forum.gitea.com/t/cannot-backup-gitea/2943>\
**Category:** General\
**Created:** [February 3, 2021, 6:40pm UTC](https://forum.gitea.com/t/cannot-backup-gitea/2943 "2021-02-03T18:40:41Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![djonmayer](https://avatars.discourse-cdn.com/v4/letter/d/dc4da7/32.png) [@djonmayer](https://forum.gitea.com/u/djonmayer)\
**Post date:** [February 3, 2021, 6:40pm UTC](https://forum.gitea.com/t/cannot-backup-gitea/2943/1 "2021-02-03T18:40:41Z")

</div>

I use gitea 1.13.2. If I run gitea dump -c /path/to/app.ini, it failed with following error:

```
git@ubuntu:/usr/local/bin$ ./gitea dump -c /etc/gitea/app.ini
2021/02/03 19:49:37 ...dules/setting/git.go:91:newGit() [I] Git Version: 2.25.1, Wire Protocol Version 2 Enabled
2021/02/03 19:49:37 ...dules/setting/log.go:297:newLogService() [I] Gitea v1.13.2 built with GNU Make 4.1, go1.15.7 : bindata, sqlite, sqlite_unlock_notify
2021/02/03 19:49:37 ...dules/setting/log.go:343:newLogService() [I] Gitea Log Mode: Console(Console:info)
2021/02/03 19:49:37 ...les/setting/cache.go:70:newCacheService() [I] Cache Service Enabled
2021/02/03 19:49:37 ...les/setting/cache.go:81:newCacheService() [I] Last Commit Cache Service Enabled
2021/02/03 19:49:37 ...s/setting/session.go:63:newSessionService() [I] Session Service Enabled
2021/02/03 19:49:37 ...es/setting/mailer.go:116:newRegisterMailService() [W] Register Mail Service: Mail Service is not enabled
2021/02/03 19:49:37 ...s/storage/storage.go:151:initAttachments() [I] Initialising Attachment storage with type:
2021/02/03 19:49:37 ...les/storage/local.go:43:NewLocalStorage() [I] Creating new Local Storage at /usr/local/bin/data/attachments
2021/02/03 19:49:37 ...s/storage/storage.go:145:initAvatars() [I] Initialising Avatar storage with type:
2021/02/03 19:49:37 ...les/storage/local.go:43:NewLocalStorage() [I] Creating new Local Storage at /usr/local/bin/data/avatars
2021/02/03 19:49:37 ...s/storage/storage.go:163:initRepoAvatars() [I] Initialising Repository Avatar storage with type:
2021/02/03 19:49:37 ...les/storage/local.go:43:NewLocalStorage() [I] Creating new Local Storage at /usr/local/bin/data/repo-avatars
2021/02/03 19:49:37 ...s/storage/storage.go:157:initLFS() [I] Initialising LFS storage with type:
Unable to open gitea-dump-1612378177.zip: open gitea-dump-1612378177.zip: permission denied
2021/02/03 19:49:37 ...les/storage/local.go:43:NewLocalStorage() [I] Creating new Local Storage at /var/lib/gitea/data/lfs
2021/02/03 19:49:37 cmd/dump.go:171:fatal() [F] Unable to open gitea-dump-1612378177.zip: open gitea-dump-1612378177.zip: permission denied

```

Permissions are:

```
root@ubuntu:/var/lib/gitea/data# ls -la
total 36
drwxr-x--- 9 git git 4096 Dez 8 16:32 .
drwxr-x--- 5 git git 4096 Jul 7 2020 ..
drwxr-xr-x 2 git git 4096 Dez 8 16:32 attachments
drwxr-xr-x 2 git git 4096 Jul 7 2020 avatars
drwxr-xr-x 4 git git 4096 Jul 7 2020 indexers
drwxr-xr-x 2 git git 4096 Jul 7 2020 lfs
drwxr-xr-x 7 git git 4096 Dez 8 16:32 queues
drwxr-xr-x 2 git git 4096 Dez 8 16:32 repo-avatars
drwx------ 15 git git 4096 Dez 26 07:59 sessions

```

What goes wrong with my instance of gitea?

Regards  
Djon

---

<div class="post-metadata">

**Author:** ![phostann](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/phostann/32/2282_2.png) [@phostann](https://forum.gitea.com/u/phostann)\
**Post date:** [February 11, 2022, 9:03am UTC](https://forum.gitea.com/t/cannot-backup-gitea/2943/2 "2022-02-11T09:03:03Z")

</div>

Hello, I have the same issue, have you solved it ?

---

<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:** [February 13, 2022, 9:11am UTC](https://forum.gitea.com/t/cannot-backup-gitea/2943/3 "2022-02-13T09:11:41Z")

</div>

Do you have enough disk space to store the temporary files.

---

<div class="post-metadata">

**Author:** ![nem8](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/nem8/32/2958_2.png) [@nem8](https://forum.gitea.com/u/nem8)\
**Post date:** [August 24, 2022, 7:41am UTC](https://forum.gitea.com/t/cannot-backup-gitea/2943/4 "2022-08-24T07:41:40Z")

</div>

First had problems with dump trying to use /usr/local/bin/data so i added APP\_DATA\_PATH in app.ini and that solved that issue.

Then i get the same problem as OP and im not sure how to solve this as permissions seem OK (same as OP), and /tmp/ has 2.8gb free.

---

<div class="post-metadata">

**Author:** ![leileibest008](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/leileibest008/32/2965_2.png) [@leileibest008](https://forum.gitea.com/u/leileibest008)\
**Post date:** [August 25, 2022, 3:47pm UTC](https://forum.gitea.com/t/cannot-backup-gitea/2943/5 "2022-08-25T15:47:11Z")

</div>

Hello, I have the same issue, have you solved it ?

---

<div class="post-metadata">

**Author:** ![nem8](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/nem8/32/2958_2.png) [@nem8](https://forum.gitea.com/u/nem8)\
**Post date:** [August 25, 2022, 4:02pm UTC](https://forum.gitea.com/t/cannot-backup-gitea/2943/6 "2022-08-25T16:02:05Z")

</div>

Nope, sorry… We already have system backup but I wanted to do the manual backup but fore upgrade. Ended up just upgrading but will check if someone posts a solution here.

---

<div class="post-metadata">

**Author:** ![eeyrjmr](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/eeyrjmr/32/1095_2.png) [@eeyrjmr](https://forum.gitea.com/u/eeyrjmr)\
**Post date:** [August 25, 2022, 9:58pm UTC](https://forum.gitea.com/t/cannot-backup-gitea/2943/7 "2022-08-25T21:58:43Z")

</div>

> [@djonmayer](#):
>
> `git@ubuntu:/usr/local/bin$ ./gitea dump -c /etc/gitea/app.ini`

you are executing this from the path /usr/local/bin. if the user you are executing this as (ie git) does not have WRITE access to /usr/local/bin it will fail with this exact error message.

its probably best todo something like this: **cd tmp; /usr/local/bin/gitea dump -c /etc/gitea/app.ini** or have gitea installed in a more FHS compliant structure and then: **cd tmp; gitea dump -c /etc/gitea/app.ini**

---

<div class="post-metadata">

**Author:** ![majorgear](https://avatars.discourse-cdn.com/v4/letter/m/49beb7/32.png) [@majorgear](https://forum.gitea.com/u/majorgear)\
**Post date:** [January 16, 2023, 10:26pm UTC](https://forum.gitea.com/t/cannot-backup-gitea/2943/8 "2023-01-16T22:26:15Z")

</div>

You can add the “–work-path” argument to change the working directory to someplace that you had access to. Apparently, the parameter used to be “–work-dir” but it was changed at some point.
