Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
34c77b5069 | |||
af61795525 |
57
README.md
57
README.md
@ -1,2 +1,57 @@
|
|||||||
# gitea-repo-migrator
|
# Mike's Gitea Repo Migrator
|
||||||
|
|
||||||
|
Just a script to help make it a little easier to migrate an entire organization (with bulk selection) from one Gitea instance to another.
|
||||||
|
|
||||||
|
Supports changing destination names a bit, and adding topics to each transferred repo, as well as optional bulk-selected deletion from the source.
|
||||||
|
|
||||||
|
by Mike Peralta
|
||||||
|
|
||||||
|
Current license: You are free to clone and use this program but all other rights reserved, provided you accept 100% of all liability of any outcome of use/download/etc this program. Better license coming soon.
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
|
||||||
|
* python 3.10
|
||||||
|
* pipenv
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
1. Clone this repo and `cd` to its root directory
|
||||||
|
|
||||||
|
2. Execute `pipenv install` (and optionally check with `pipenv check`)
|
||||||
|
|
||||||
|
## Execution
|
||||||
|
|
||||||
|
Ask `pipenv` to execute *main.py* on your behalf with the following:
|
||||||
|
|
||||||
|
```console
|
||||||
|
|
||||||
|
$ cd /path/to/gitea-repo-migrator
|
||||||
|
$ pipenv run python ./main.py --help
|
||||||
|
```
|
||||||
|
|
||||||
|
Optionally ask for a shell to run multiple times a bit faster:
|
||||||
|
|
||||||
|
```console
|
||||||
|
|
||||||
|
$ cd /path/to/gitea-repo-migrator
|
||||||
|
$ pipenv shell
|
||||||
|
$ python ./main.py --help
|
||||||
|
$ python ./main.py --help
|
||||||
|
```
|
||||||
|
|
||||||
|
### App Tokens
|
||||||
|
|
||||||
|
You'll need to generate an *Application Token* for both the source and destination servers, and pass the token along to the command line.
|
||||||
|
|
||||||
|
### SSL Verification
|
||||||
|
|
||||||
|
Pass the long switch `--no-verify-ssl` if any server sits behind a self-signed or wonky SSL certificate.
|
||||||
|
|
||||||
|
### Destination Repo Names
|
||||||
|
|
||||||
|
You can tweak the destination repo names a bit by using a string that includes `%N%` somewhere. The string `%N%` will expand to the original name. For example, if we use a repo originally named `my-test-repo` with the string `what-%N%`, the resulting destination repo name will be `what-my-test-repo`. This string will be recomputed for every migrated repo.
|
||||||
|
|
||||||
|
### Destination Topics
|
||||||
|
|
||||||
|
Topics will be duplicated from all source repos to their corresponding destination repos. You can specify additional topics with the `--destination-topic` switch. For example, to add the topic `migrated` to every repo, pass the switch `--destination-topic migrated`.
|
||||||
|
|
||||||
|
2
main.py
2
main.py
@ -68,7 +68,7 @@ def main():
|
|||||||
"--destination-repo-name", "--destination-name", "--dest-repo-name", "--dest-name",
|
"--destination-repo-name", "--destination-name", "--dest-repo-name", "--dest-name",
|
||||||
dest="destination_repo_name",
|
dest="destination_repo_name",
|
||||||
default="%N%",
|
default="%N%",
|
||||||
help="Specify the destination repository name(s). Use wildcard %N% anywhere to denote the original name"
|
help="Specify the destination repository name(s). Use wildcard %%N%% anywhere to denote the original name"
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--destination-add-topic", "--destination-topic", "-dest-add-topic", "--dest-topic",
|
"--destination-add-topic", "--destination-topic", "-dest-add-topic", "--dest-topic",
|
||||||
|
Reference in New Issue
Block a user