Open TobiGr opened 2 years ago
GitLab also added support for migrating attachments. That's their default values now:
I had the same problem, and hacked a script in Python that is adds missing images/attachments to issues and comments.
The attachments are identified by their Gitlab path/filename and Gitlabs internal gitlab-rails/uploads
with all attachments is needed.
To access Gitea a token with (at least) the following permission is needed: read:organization, write:issue, read:repository.
$ ./script.py --help
usage: script.py [-h] --attachment-directory ATTACHMENT_DIRECTORY --gitea GITEA --token TOKEN [--repo REPO | --repo-search]
Migrate attachments from Gitlab Issues to Gitea
options:
-h, --help show this help message and exit
--attachment-directory ATTACHMENT_DIRECTORY, -a ATTACHMENT_DIRECTORY
Attachment directory, e.g. a copy of '/var/opt/gitlab/gitlab-rails/uploads' from a Gitlab Omnibus installation
--gitea GITEA, -g GITEA
URL of the Gitea Instance, e.g. https://demo.gitea.com/
--token TOKEN, -t TOKEN
Gitea Auth token
--repo REPO, -r REPO Name of the repo where attachments will be migrated. Full name is required, e.g. 'some-org/some-repo'.
--repo-search, -s Query list of all repos from Gitea API and migrate all attachments.
Feature Description
Currently, migrations from other services like GitHub or GitLab copy the complete issue contents into Gitea. If a user inserted an image or video into an issue or PR, the URL to the media source is present in the migrated issue on Gitea. However, if the corresponding repository is deleted, the media is also going to be deleted automatically by time. The same applies when e.g. a custom GitLab instance is shut down. To allow complete and persistent migrations, those manually uploaded files should be migrated, too. In some cases this might not be necessary. Migrating many media files causes a lot of traffic, too. Therefore, I suggest to add an option to migrate the whole content when setting up the migration.
Screenshots
No response