Restore: lack of information #2258

Closed
opened 2025-11-02 04:29:55 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @markuman on GitHub (Aug 27, 2018).

When restore a gitea instance, everything works for me, execept for the build-in wiki when the paths of gitea binary and location of app.ini changed.
Because all repositories with a wiki in-use have pre-, updateand post-receive hooks with hardcoded path for gitea binary and app.ini.
Luckily this can be fixed with the power of grep and sed

when the former location of gitea binary was /home/olduser/gitea/gitea and is now /app/gitea/gitea

grep -rl '/home/olduser/gitea/gitea' gitea-repositories/* | while read filename; do 
    sed -i 's,/home/olduser/gitea/gitea,/app/gitea/gitea,g' "$filename"; 
done

and for the former location of /home/olduser/gitea/custom/conf/app.ini, which is now /data/gitea/conf/app.ini

grep -rl '/home/olduser/gitea/custom/conf/app.ini' gitea-repositories/* | while read filename; do 
    sed -i 's,/home/olduser/gitea/custom/conf/app.ini,/data/gitea/conf/app.ini,g' "$filename"; 
done

Maybe this someone runs into the same trouble...and maybe this should be added (in some form) to the restore documentation? What do you think?

Originally created by @markuman on GitHub (Aug 27, 2018). When restore a gitea instance, everything works for me, execept for the build-in wiki when the paths of `gitea` binary and location of `app.ini` changed. Because all repositories with a wiki in-use have `pre-`, `update`and `post-receive` hooks with hardcoded path for `gitea` binary and `app.ini`. Luckily this can be fixed with the power of grep and sed when the former location of `gitea` binary was `/home/olduser/gitea/gitea` and is now `/app/gitea/gitea` ``` grep -rl '/home/olduser/gitea/gitea' gitea-repositories/* | while read filename; do sed -i 's,/home/olduser/gitea/gitea,/app/gitea/gitea,g' "$filename"; done ``` and for the former location of `/home/olduser/gitea/custom/conf/app.ini`, which is now `/data/gitea/conf/app.ini` ``` grep -rl '/home/olduser/gitea/custom/conf/app.ini' gitea-repositories/* | while read filename; do sed -i 's,/home/olduser/gitea/custom/conf/app.ini,/data/gitea/conf/app.ini,g' "$filename"; done ``` Maybe this someone runs into the same trouble...and maybe this should be added (in some form) to the restore documentation? What do you think?
GiteaMirror added the type/question label 2025-11-02 04:29:55 -06:00
Author
Owner

@lunny commented on GitHub (Aug 28, 2018):

You can rewrite then on Admin Panel.

@lunny commented on GitHub (Aug 28, 2018): You can rewrite then on Admin Panel.
Author
Owner

@techknowlogick commented on GitHub (Aug 28, 2018):

Please feel free to open PR adding this to the restore documentation. This already exists on the troubleshooting page.

I will now close this issue.

@techknowlogick commented on GitHub (Aug 28, 2018): Please feel free to open PR adding this to the restore documentation. This already exists on the troubleshooting page. I will now close this issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#2258