Skip to content

dump / backup does not contain data directory #11220

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
2 of 7 tasks
MonkeySon opened this issue Apr 26, 2020 · 1 comment
Closed
2 of 7 tasks

dump / backup does not contain data directory #11220

MonkeySon opened this issue Apr 26, 2020 · 1 comment

Comments

@MonkeySon
Copy link

  • Gitea version (or commit ref): 1.11.4
  • Git version: 2.20.1
  • Operating system: Ubuntu 19.10 Server
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

I was trying to create a backup of my Gitea instance as found on the official docs. As I run my gitea as a service, I prepended the working directory manually when running the command. But the resulting zip files misses the data and custom directories. The log file states that it searched for custom at /usr/local/bin/ which is obviously the wrong directory. Maybe the data directory was silently skipped after that.

Is this a bug or am I missing something?

Commands and resulting zip file:

git@homeserver:~$ GITEA_WORK_DIR=/var/lib/gitea/; gitea dump -c /etc/gitea/app.ini
2020/04/26 17:55:09 ...dules/setting/git.go:91:newGit() [I] Git Version: 2.20.1, Wire Protocol Version 2 Enabled
git@homeserver:~$ unzip -l gitea-dump-1587916509.zip 
Archive:  gitea-dump-1587916509.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
    90955  2020-04-26 17:55   gitea-db.sql
     1751  2020-04-19 18:49   app.ini
   386969  2020-04-26 17:55   gitea-repo.zip
        0  2020-04-26 17:55   log/
    10661  2020-04-22 00:05   log/gitea.log.2020-04-22.001.gz
   276985  2020-04-26 17:55   log/gitea.log
    21062  2020-04-21 00:05   log/gitea.log.2020-04-21.001.gz
    29819  2020-04-25 00:05   log/gitea.log.2020-04-25.001.gz
     2744  2020-04-24 00:05   log/gitea.log.2020-04-24.001.gz
   131732  2020-04-20 00:05   log/gitea.log.2020-04-20.001.gz
    12852  2020-04-26 00:05   log/gitea.log.2020-04-26.001.gz
     6231  2020-04-23 00:05   log/gitea.log.2020-04-23.001.gz
---------                     -------
   971761                     12 files

Log file:

2020/04/26 17:55:09 ...dules/setting/log.go:276:newLogService() [I] Gitea Log Mode: File(File:info)
2020/04/26 17:55:09 ...les/setting/cache.go:45:newCacheService() [I] Cache Service Enabled
2020/04/26 17:55:09 ...s/setting/session.go:44:newSessionService() [I] Session Service Enabled
2020/04/26 17:55:09 cmd/dump.go:80:runDump() [I] Creating tmp work dir: /tmp/gitea-dump-120227348
2020/04/26 17:55:09 cmd/dump.go:90:runDump() [I] Packing dump files...
2020/04/26 17:55:09 cmd/dump.go:101:runDump() [I] Dumping local repositories.../home/git/gitea-repositories
2020/04/26 17:55:09 cmd/dump.go:115:runDump() [I] Dumping database...
2020/04/26 17:55:09 cmd/dump.go:127:runDump() [I] Adding custom configuration file from /etc/gitea/app.ini
2020/04/26 17:55:09 cmd/dump.go:139:runDump() [I] Custom dir /usr/local/bin/custom doesn't exist, skipped
2020/04/26 17:55:09 cmd/dump.go:169:runDump() [I] Removing tmp work dir: /tmp/gitea-dump-120227348

Thanks for your help :)

@MonkeySon
Copy link
Author

Okay, problem solved. I had to set the working directory with -w or --work-path and not via environment variable.
Like so: gitea dump -c /etc/gitea/app.ini -w /var/lib/gitea/

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant