Skip to content

Update database from Git Repositories #8774

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
tcyrus opened this issue Nov 1, 2019 · 7 comments
Closed
2 of 7 tasks

Update database from Git Repositories #8774

tcyrus opened this issue Nov 1, 2019 · 7 comments
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/question Issue needs no code to be fixed, only a description on how to fix it yourself.

Comments

@tcyrus
Copy link

tcyrus commented Nov 1, 2019

  • Gitea version (or commit ref): 1.9.2
  • Git version: N/A
  • Operating system: Ubuntu
  • 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

My database server had an issue unrelated to Gitea, but I lost some of the database records. I restored a backup of the database, but some of the repositories are missing from this copy.

I was wondering if there was an admin command to do the reverse of "Reinitialize all missing Git repositories for which records exist", where it would "Reinitialize all missing records for which Git repositories exist".

@guillep2k
Copy link
Member

You can enable IMPORT_LOCAL_PATHS = true in app.ini and manually import those repositories. They will be created anew in the database; no issues/PRs/labels/etc will exist but the code will be there. For this to work you must first move them out of their current location (i.e. from gitea-repositories/{owner}/... to another directory).
I know it isn't much, but may be it will help.

@guillep2k
Copy link
Member

This, however, could be an interesting function for a Gitea utility to have.

@zeripath
Copy link
Contributor

zeripath commented Nov 1, 2019

Yeah I think we should make it possible recover data - however, it's a slightly difficult situation. With a completely brand new Gitea do you create users for each of the recovered repositories? - but they might have meant to be organisations so this is probably not correct. So you should probably leave it till users are created - and then restore?

@guillep2k
Copy link
Member

Yeah I think we should make it possible recover data - however, it's a slightly difficult situation. With a completely brand new Gitea do you create users for each of the recovered repositories? - but they might have meant to be organisations so this is probably not correct. So you should probably leave it till users are created - and then restore?

It's pretty easy: recreate those that have a matching user, report those that don't. 😁

@lunny lunny added the type/question Issue needs no code to be fixed, only a description on how to fix it yourself. label Nov 2, 2019
@stale
Copy link

stale bot commented Jan 1, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale stale bot added the issue/stale label Jan 1, 2020
@lunny
Copy link
Member

lunny commented Jan 1, 2020

Since push to create feature has been implemented, I think we can close this now.

@stale stale bot removed the issue/stale label Jan 1, 2020
@stale
Copy link

stale bot commented Mar 1, 2020

This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.

@stale stale bot added the issue/stale label Mar 1, 2020
@zeripath zeripath added the issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented label Mar 3, 2020
@stale stale bot removed the issue/stale label Mar 3, 2020
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/question Issue needs no code to be fixed, only a description on how to fix it yourself.
Projects
None yet
Development

No branches or pull requests

5 participants