# Issues relating to backup/restore gitea

**URL:** <https://forum.gitea.com/t/issues-relating-to-backup-restore-gitea/8288>\
**Category:** Install/Maintain/Configure\
**Created:** [December 13, 2023, 10:45pm UTC](https://forum.gitea.com/t/issues-relating-to-backup-restore-gitea/8288 "2023-12-13T22:45:41Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![jahway603](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/jahway603/32/4187_2.png) [@jahway603](https://forum.gitea.com/u/jahway603)\
**Post date:** [December 13, 2023, 10:45pm UTC](https://forum.gitea.com/t/issues-relating-to-backup-restore-gitea/8288/1 "2023-12-13T22:45:41Z")

</div>

I’ve searched a lot both online, in gitea’s github issues, and in these forums for help, but none of what I had found had been helpful, so I’m not posting a new topic to get help from the community.

Information about the server: it’s running version 1.15.9 with the plan of upgrading this to the latest release (incrementally) after it is successfully restored to a new server. It’s running in Docker.

Steps to Reproduce Issue:

1. The backup on the old server was conducted using the steps here  
[Backup and Restore | Gitea Documentation](https://docs.gitea.com/administration/backup-and-restore#backup-command-dump)

2. Then the backed up ` gitea-dump-1699660123.zip` gets created. I can download that to my desktop computer and it unzips without any issues.

3. I rsync ` gitea-dump-1699660123.zip` to the new server & that works fine.

4. I run `docker cp gitea-dump-1699660123.zip gitea:/tmp/` to copy the backup into the docker container.

5. ISSUE #1: I open a shell in the docker container and run `unzip gitea-dump-1699660123.zip ` which results in the following:

6. I’m unable to get past the above ISSUE #1, so I try the same process on 2 different servers, which give the same result.

7. I then try something new and unzip ` gitea-dump-1699660123.zip` in a directory outside of docker and decide to `docker cp everyhing` such as:

8. I then run the restore process as outlined here [Backup and Restore | Gitea Documentation](https://docs.gitea.com/administration/backup-and-restore#backup-command-dump)

9. ISSUE #2: This appears to work and users are able to login, but clicking on any repo gives an `Internal Server Error 500`.

10. I then set `RUN_MODE=dev` in `app.ini` & restart the gitea server.

11. Now when I click on any of the repos on the new server, I get the following error message:

12. It’s not clear how to troubleshoot this issue, so I spun up a brand new VPS and got stuck again extracting the backup:

Does anyone have any ideas on things to try to restore from the backup successfully?

---

<div class="post-metadata">

**Author:** ![jahway603](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/jahway603/32/4187_2.png) [@jahway603](https://forum.gitea.com/u/jahway603)\
**Post date:** [December 25, 2023, 2:21pm UTC](https://forum.gitea.com/t/issues-relating-to-backup-restore-gitea/8288/2 "2023-12-25T14:21:15Z")

</div>

bump as gitea just released a new version and I’m still unable to upgrade and need suggestions from others here.

---

<div class="post-metadata">

**Author:** ![jahway603](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/jahway603/32/4187_2.png) [@jahway603](https://forum.gitea.com/u/jahway603)\
**Post date:** [January 1, 2024, 3:44pm UTC](https://forum.gitea.com/t/issues-relating-to-backup-restore-gitea/8288/3 "2024-01-01T15:44:53Z")

</div>

Bump, bump, bump, bump, bump 😀

---

<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:** [January 1, 2024, 3:52pm UTC](https://forum.gitea.com/t/issues-relating-to-backup-restore-gitea/8288/4 "2024-01-01T15:52:33Z")

</div>

What is the docker based upon?  
Is it alpine? If so are you using the REAL unzip or the function provided by busybox.

Busybox’s unzip has historically had this issue

---

<div class="post-metadata">

**Author:** ![TonyRogers](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/tonyrogers/32/4315_2.png) [@TonyRogers](https://forum.gitea.com/u/TonyRogers)\
**Post date:** [January 3, 2024, 9:56pm UTC](https://forum.gitea.com/t/issues-relating-to-backup-restore-gitea/8288/5 "2024-01-03T21:56:55Z")

</div>

Could it be a permissions issue? Are the files that you restore owned by the correct user?

---

<div class="post-metadata">

**Author:** ![jahway603](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/jahway603/32/4187_2.png) [@jahway603](https://forum.gitea.com/u/jahway603)\
**Post date:** [January 5, 2024, 3:58am UTC](https://forum.gitea.com/t/issues-relating-to-backup-restore-gitea/8288/6 "2024-01-05T03:58:16Z")

</div>

I am following the [official docker documentation here](https://docs.gitea.com/installation/install-with-docker), which does not tell me what OS is running in the docker container, but `cat /etc/os-release` in docker confirms it’s Alpine-based. I did not realize it was using busybox for unzipping (checked /usr/bin and found unzip symlink to busybox).

I installed the real unzip and was able to successfully do this on two different servers. Thank you very much for your help.

---

<div class="post-metadata">

**Author:** ![gonsalvesc](https://avatars.discourse-cdn.com/v4/letter/g/f19dbf/32.png) [@gonsalvesc](https://forum.gitea.com/u/gonsalvesc)\
**Post date:** [April 12, 2024, 10:13pm UTC](https://forum.gitea.com/t/issues-relating-to-backup-restore-gitea/8288/7 "2024-04-12T22:13:01Z")

</div>

I’m having the same trouble. Mine is alpine-based too.

How did you install the real unzip?

---

<div class="post-metadata">

**Author:** ![jahway603](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/jahway603/32/4187_2.png) [@jahway603](https://forum.gitea.com/u/jahway603)\
**Post date:** [April 15, 2024, 2:06am UTC](https://forum.gitea.com/t/issues-relating-to-backup-restore-gitea/8288/8 "2024-04-15T02:06:44Z")

</div>

You can install the unzip on Alpine with the following command

```auto
apk add unzip

```

---

<div class="post-metadata">

**Author:** ![gonsalvesc](https://avatars.discourse-cdn.com/v4/letter/g/f19dbf/32.png) [@gonsalvesc](https://forum.gitea.com/u/gonsalvesc)\
**Post date:** [April 17, 2024, 4:00am UTC](https://forum.gitea.com/t/issues-relating-to-backup-restore-gitea/8288/9 "2024-04-17T04:00:42Z")

</div>

Thank you!  
Instead of unzipping the backup inside the container, I just did it on the host and moved the folders to the data mount path. This worked as well.

```bash
mkdir backup
cd backup
cp /path/to/gitea-dump-20240414-0018.zip ./
unzip gitea-dump-20240414-0018.zip
mv data/ gitea
mkdir data
mv gitea data/
mkdir data/git
mv repos/ repositories
mv repositories/ data/git/
sudo mv data/ /path/to/mount/
docker compose up -d --force-recreate
docker exec -u git -it gitea /usr/local/bin/gitea -c '/data/gitea/conf/app.ini' admin regenerate hooks
docker restart gitea

```

Hope this helps.
