pagure-exporter


Namepagure-exporter JSON
Version 0.1.3 PyPI version JSON
download
home_pagehttps://github.com/gridhead/pagure-exporter
SummarySimple exporter tool that helps migrate repository files, data assets and issue tickets from projects on Pagure to GitLab
upload_time2024-03-12 03:37:45
maintainerAkashdeep Dhar
docs_urlNone
authorAkashdeep Dhar
requires_python>=3.11,<4.0
licenseGPL-3.0-or-later
keywords fedora pagure gitlab
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Pagure Exporter

Simple exporter tool that helps migrate repository files, data assets and issue tickets from projects on Pagure to GitLab

## Installation

### From PyPI

1. Ensure that you have `python3` and `python3-pip` installed.

    ```
    $ sudo dnf install python3 python3-pip --setopt=install_weak_deps=False
    ```

2. Create and activate a Python virtual environment in that directory.

    ```
    $ python3 -m venv venv
    ```

    ```
    (venv) $ source venv/bin/activate
    ```

3. Install `pagure-exporter` using `pip` in the activated virtual environment.

    ```
    (venv) $ pip install pagure-exporter
    ```

    Sample output

    ```
    Requirement already satisfied: pagure-exporter in ./venv/lib/python3.12/site-packages (0.1.0)
    Requirement already satisfied: GitPython<4.0.0,>=3.1.37 in ./venv/lib/python3.12/site-packages (from pagure-exporter) (3.1.40)
    Requirement already satisfied: click<9.0.0,>=8.1.3 in ./venv/lib/python3.12/site-packages (from pagure-exporter) (8.1.7)
    Requirement already satisfied: requests<3.0.0,>=2.31.0 in ./venv/lib/python3.12/site-packages (from pagure-exporter) (2.31.0)
    Requirement already satisfied: tqdm<5.0.0,>=4.64.1 in ./venv/lib/python3.12/site-packages (from pagure-exporter) (4.66.1)
    Requirement already satisfied: gitdb<5,>=4.0.1 in ./venv/lib/python3.12/site-packages (from GitPython<4.0.0,>=3.1.37->pagure-exporter) (4.0.10)
    Requirement already satisfied: charset-normalizer<4,>=2 in ./venv/lib64/python3.12/site-packages (from requests<3.0.0,>=2.31.0->pagure-exporter) (3.3.0)
    Requirement already satisfied: idna<4,>=2.5 in ./venv/lib/python3.12/site-packages (from requests<3.0.0,>=2.31.0->pagure-exporter) (3.4)
    Requirement already satisfied: urllib3<3,>=1.21.1 in ./venv/lib/python3.12/site-packages (from requests<3.0.0,>=2.31.0->pagure-exporter) (2.0.7)
    Requirement already satisfied: certifi>=2017.4.17 in ./venv/lib/python3.12/site-packages (from requests<3.0.0,>=2.31.0->pagure-exporter) (2023.7.22)
    Requirement already satisfied: smmap<6,>=3.0.1 in ./venv/lib/python3.12/site-packages (from gitdb<5,>=4.0.1->GitPython<4.0.0,>=3.1.37->pagure-exporter) (5.0.1)
    ```

### From source

1. Ensure that you have `git`, `python3` and `poetry` installed.

    ```
    $ sudo dnf install git python3 poetry --setopt=install_weak_deps=False
    ```

2. Clone the repository to the local storage and make it the present working directory.

    ```
    $ git clone https://github.com/gridhead/pagure-exporter.git
    ```

    ```
    $ cd pagure-exporter
    ```

    Sample output

    ```
    Cloning into 'pagure-exporter'...
    remote: Enumerating objects: 118, done.
    remote: Counting objects: 100% (118/118), done.
    remote: Compressing objects: 100% (78/78), done.
    remote: Total 118 (delta 48), reused 94 (delta 31), pack-reused 0
    Receiving objects: 100% (118/118), 56.38 KiB | 4.34 MiB/s, done.
    Resolving deltas: 100% (48/48), done.
    ```

3. Create and activate a Python virtual environment in that directory.

    ```
    $ python3 -m venv venv
    ```

    ```
    (venv) $ source venv/bin/activate
    ```

4. Check the project configuration's validity and then install the project dependencies.

    ```
    (venv) $ poetry check
    ```

    ```
    (venv) $ poetry install
    ```

    Sample output

    ```
    All set!
    ```

    ```
    Installing dependencies from lock file

    Package operations: 19 installs, 0 updates, 0 removals

      • Installing smmap (5.0.0)
      • Installing certifi (2022.12.7)
      • Installing charset-normalizer (3.0.1)
      • Installing click (8.1.3)
      • Installing gitdb (4.0.10)
      • Installing idna (3.4)
      • Installing mccabe (0.6.1)
      • Installing mypy-extensions (0.4.3)
      • Installing pathspec (0.11.0)
      • Installing platformdirs (2.6.2)
      • Installing pycodestyle (2.8.0)
      • Installing pyflakes (2.4.0)
      • Installing urllib3 (1.26.14)
      • Installing black (22.12.0)
      • Installing flake8 (4.0.1)
      • Installing gitpython (3.1.30)
      • Installing isort (5.12.0)
      • Installing requests (2.28.2)
      • Installing tqdm (4.64.1)

    Installing the current project: pagure-exporter (0.1.0)
    ```

## Usage

### Setup

1. Using an internet browser of your choice, open up [**Pagure**](https://pagure.io) and login to your account.

    ![](https://raw.githubusercontent.com/gridhead/pagure-exporter/main/data/01.png)

2. Click on your profile display picture and then, head over to the [**Account Settings**](https://pagure.io/settings) page.

    ![](https://raw.githubusercontent.com/gridhead/pagure-exporter/main/data/02.png)

3. Under the [**API Keys**](https://pagure.io/settings#nav-api-tab) section, click on the [**Create new API key**](https://pagure.io/settings/token/new) button in the top right corner.

    ![](https://raw.githubusercontent.com/gridhead/pagure-exporter/main/data/03.png)

4. As this is the source namespace, check all the ACLs that are required to read the asset information associated with a repository, set a safe expiration date for the API token and write an appropriate description for its usage before clicking on the [**Create**](#) button.

    ![](https://raw.githubusercontent.com/gridhead/pagure-exporter/main/data/04.png)

5. Make note of the API token generated and ensure that they are not shared with others or used for a different purpose.

    ![](https://raw.githubusercontent.com/gridhead/pagure-exporter/main/data/05.png)

6. Head over to a repository that the currently logged-in username has at least a READ access to.

    ![](https://raw.githubusercontent.com/gridhead/pagure-exporter/main/data/06.png)

7. Make note of the source namespace in the format of `HOLDER/REPONAME` where the `HOLDER` can be a group or a sole user.
   For example, in case of a repository located at `https://pagure.io/fedora-infra/ansible` - the source namespace would be `fedora-infra/ansible`.

    ![](https://raw.githubusercontent.com/gridhead/pagure-exporter/main/data/07.png)

8. In another internet browser tab or window, open up [**GitLab**](https://gitlab.com/) and login to your account.

    ![](https://raw.githubusercontent.com/gridhead/pagure-exporter/main/data/08.png)

9. Click on the [**New project/repository**](https://gitlab.com/projects/new) option from the sidebar of the profile page and then, click on the [**Create blank project**](https://gitlab.com/projects/new#blank_project) option.

    ![](https://raw.githubusercontent.com/gridhead/pagure-exporter/main/data/09.png)

10. Create a new empty repository which will act as the destination for the asset transfer. It is recommended to have the same name as the source namespace to avoid confusion, but it is not strictly required.

    ![](https://raw.githubusercontent.com/gridhead/pagure-exporter/main/data/10.png)

11. Head over to the created repository and make note of the **Project ID**.
    For example in this case, it is `42823949` for the destination repository named `gridhead/pagure-exporter-test`.

    ![](https://raw.githubusercontent.com/gridhead/pagure-exporter/main/data/11.png)

12. Expand the sidebar to head over to the [**Repository**](#) section from the [**Settings**](#) section.

    ![](https://raw.githubusercontent.com/gridhead/pagure-exporter/main/data/17.png)

13. In the [**Protected Branches**](#) section, turn off all existing *branch protection rules* and *allow force pushing* to all branches temporarily to allow for the repository assets to be moved in here.

    ![](https://raw.githubusercontent.com/gridhead/pagure-exporter/main/data/18.png)

14. Expand the sidebar to head over to the [**Access Tokens**](#) section from the [**Settings**](#) section.

    ![](https://raw.githubusercontent.com/gridhead/pagure-exporter/main/data/12.png)

15. In the [**Project Access Token**](#) page, click on the [**Add new token**](#) button to begin creating a new access token.

    ![](https://raw.githubusercontent.com/gridhead/pagure-exporter/main/data/13.png)

16. As this is the destination namespace, check all the scopes that are required to write the asset information associated with a repository, pick an appropriate role, set a safe expiration date and write an appropriate description for its usage before clicking on the [**Create project access token**](#) button.

    ![](https://raw.githubusercontent.com/gridhead/pagure-exporter/main/data/14.png)

17. Make note of the API token generated and ensure that they are not shared with others or used for a different purpose.

    ![](https://raw.githubusercontent.com/gridhead/pagure-exporter/main/data/15.png)

18. Ensure that you have the following information handy before proceeding to the next steps.

    1. Username of an account that has at least the READ permissions in the source namespace on Pagure (Say `srceuser`)
    2. Access token belonging to the aforementioned account with appropriate ACLs checked required for at least the READ permissions in the source namespace (Say `srcecode`)
    3. Name of the source namespace in the format `HOLDER/REPONAME` where the `HOLDER` can be a group or a sole user (Say `srcerepo`)
    4. Username of an account that has at least the WRITE permissions in the destination namespace on GitLab (Say `destuser`)
    5. Access token belonging to that aforementioned account appropriate roles and scopes required for at least the WRITE permissions in the destination namespace (Say `destcode`)
    6. Name of the destination namespace in the format of uniquely identifiable `PROJECTID` string (Say `destrepo`)

## Operate

### View help menu

1. Check the current version of the installed project as well as the usage information.

    ```
    (venv) $ pagure-exporter --version
    ```

    ```
    (venv) $ pagure-exporter --help
    ```

    Sample output

    ```
    Pagure Exporter by Akashdeep Dhar <t0xic0der@fedoraproject.org>, version 0.1.0
    ```

    ```
    Usage: pagure-exporter [OPTIONS] COMMAND [ARGS]...

    Options:
      -s, --srce TEXT  Source namespace for importing assets from  [required]
      -d, --dest TEXT  Destination namespace for exporting assets to  [required]
      -p, --pkey TEXT  Pagure API key for accessing the source namespace
                       [required]
      -g, --gkey TEXT  GitLab API key for accessing the destination namespace
                       [required]
      -f, --fusr TEXT  Username of the account that owns the Pagure API key
                       [required]
      -t, --tusr TEXT  Username of the account that owns the GitLab API key
                       [required]
      --version        Show the version and exit.
      --help           Show this message and exit.

    Commands:
      repo  Initialize transfer of repository assets
      tkts  Initiate transfer of issue tickets
    ```

2. Check the usage information of the available subcommands.

    ```
    (venv) $ pagure-exporter -s a -d a -p a -g a -f a -t a repo --help
    ```

    ```
    (venv) $ pagure-exporter -s a -d a -p a -g a -f a -t a tkts --help
    ```

    Sample output

    ```
    Usage: pagure-exporter repo [OPTIONS]

      Initialize transfer of repository assets

    Options:
      -b, --brcs TEXT  List of branches to extract
      --help           Show this message and exit.
    ```

    ```
    Usage: pagure-exporter tkts [OPTIONS]

      Initiate transfer of issue tickets

    Options:
      -s, --status [OPEN|SHUT|FULL]  Extract issue tickets of the mentioned status
                                     [default: OPEN]
      -r, --ranges TEXT...           Extract issue tickets in the mentioned ranges
      -p, --select TEXT              Extract issue tickets of the selected numbers
      -c, --comments                 Transfer all the associated comments
      -l, --labels                   Migrate all the associated labels
      -a, --commit                   Assert issue ticket states as they were
      -t, --secret                   Confirm issue ticket privacy as they were
      --help                         Show this message and exit.
    ```

### Migrate repository files

1. Ensure that the location where the project repository was cloned is the present working directory and that the previously populated virtual environment is enabled.

    ```
    $ cd pagure-exporter
    ```

    ```
    $ source venv/bin/activate
    ```

2. Using an internet browser of your choice, visit the source namespace repository page on Pagure to pick the branches that you wish to transfer.

    ![](https://raw.githubusercontent.com/gridhead/pagure-exporter/main/data/16.png)

3. Execute the following command to begin migrating the repository assets from the source namespace on Pagure to the destination namespace on GitLab.

    1. If only a set of branches are to be migrated

        ```
        (venv) $ pagure-exporter \
                 --fusr srceuser --pkey srcecode --srce srcerepo \
                 --tusr destuser --gkey destcode --dest destrepo \
                 repo \
                 --brcs brca,brcb,brcc,brcd
        ```

        For a set of branches available in the source namespace named `brca`, `brcb`, `brcc` and `brcd` to be migrated to the destination namespace.

    2. If all the available branches are to be migrated

        ```
        (venv) $ pagure-exporter \
                 --fusr srceuser --pkey srcecode --srce srcerepo \
                 --tusr destuser --gkey destcode --dest destrepo \
                 repo
        ```

       This is the default behaviour of the subcommand so if no branch names are provided, all the branches from the source namespace are migrated

4. If there are any contents available in the branches of the destination namespace, they will be overwritten by the contents from the branches migrated from the source namespace.

### Migrate issue tickets

1. Ensure that the location where the project repository was cloned is the present working directory and that the previously populated virtual environment is enabled.

    ```
    $ cd pagure-exporter
    ```

    ```
    $ source venv/bin/activate
    ```

2. Execute the following command to begin extracting the issue tickets from the source namespace on Pagure to the destination namespace.

   1. If the issue tickets of a certain status need to be transferred.

      ```
      (venv) $ pagure-exporter \
                 --fusr srceuser --pkey srcecode --srce srcerepo \
                 --tusr destuser --gkey destcode --dest destrepo \
                 tkts \
                 --status open
      ```

   2. If the comments associated with the issue tickets need to be transferred.

      ```
      (venv) $ pagure-exporter \
                 --fusr srceuser --pkey srcecode --srce srcerepo \
                 --tusr destuser --gkey destcode --dest destrepo \
                 tkts \
                 --comments
      ```

   3. If the labels associated with the issue tickets need to be transferred.

      ```
      (venv) $ pagure-exporter \
                 --fusr srceuser --pkey srcecode --srce srcerepo \
                 --tusr destuser --gkey destcode --dest destrepo \
                 tkts \
                 --labels
      ```

   4. If the states associated with the issue tickets need to be transferred.

      ```
      (venv) $ pagure-exporter \
                 --fusr srceuser --pkey srcecode --srce srcerepo \
                 --tusr destuser --gkey destcode --dest destrepo \
                 tkts \
                 --commit
      ```

   5. If the privacy associated with the issue tickets need to be transferred.

      ```
      (venv) $ pagure-exporter \
                 --fusr srceuser --pkey srcecode --srce srcerepo \
                 --tusr destuser --gkey destcode --dest destrepo \
                 tkts \
                 --secret
      ```

   6. If the issue tickets from a range of issue identities need to be transferred.

      ```
      (venv) $ pagure-exporter \
                 --fusr srceuser --pkey srcecode --srce srcerepo \
                 --tusr destuser --gkey destcode --dest destrepo \
                 tkts \
                 --ranges STRT STOP
      ```

      Issue tickets with identities `STRT`, `STRT+1` ... `STOP-1`, `STOP` would be considered here.

   7. If the issue tickets that need to be considered need to be cherry-picked.

      ```
      (venv) $ pagure-exporter \
                 --fusr srceuser --pkey srcecode --srce srcerepo \
                 --tusr destuser --gkey destcode --dest destrepo \
                 tkts \
                 --select NUM1,NUM2,NUM3 ...
      ```

      Issue tickets with identities `NUM1`, `NUM2`, `NUM3` ... would be considered here.

   While these options can be mixed and matched to be used together, the options `--ranges` and `--select` cannot be used at the same time as they perform identical functions.

   For example,

      1. The following command will migrate all issue tickets, the identities of which fall between the range of `STRT` and `STOP` both included, with status `OPEN` along with the associated comments, labels and privacy.

         ```
         (venv) $ pagure-exporter \
                    --fusr srceuser --pkey srcecode --srce srcerepo \
                    --tusr destuser --gkey destcode --dest destrepo \
                    tkts \
                    --status open \
                    --comments \
                    --labels \
                    --secret \
                    --ranges STRT STOP
         ```

      2. The following command will migrate all issue tickets with the identities `NUM1`, `NUM2`, `NUM3` ... with status `SHUT` along with the associated labels, states and privacy.

         ```
         (venv) $ pagure-exporter \
                    --fusr srceuser --pkey srcecode --srce srcerepo \
                    --tusr destuser --gkey destcode --dest destrepo \
                    tkts \
                    --status shut \
                    --labels \
                    --commit \
                    --secret \
                    --select NUM1,NUM2,NUM3 ...
         ```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/gridhead/pagure-exporter",
    "name": "pagure-exporter",
    "maintainer": "Akashdeep Dhar",
    "docs_url": null,
    "requires_python": ">=3.11,<4.0",
    "maintainer_email": "akashdeep.dhar@gmail.com",
    "keywords": "fedora,pagure,gitlab",
    "author": "Akashdeep Dhar",
    "author_email": "akashdeep.dhar@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/5c/c7/5d68bb3ac7e33d982bf8f547e367c60632c4cb372cb9ed97c3508d700b43/pagure_exporter-0.1.3.tar.gz",
    "platform": null,
    "description": "# Pagure Exporter\n\nSimple exporter tool that helps migrate repository files, data assets and issue tickets from projects on Pagure to GitLab\n\n## Installation\n\n### From PyPI\n\n1. Ensure that you have `python3` and `python3-pip` installed.\n\n    ```\n    $ sudo dnf install python3 python3-pip --setopt=install_weak_deps=False\n    ```\n\n2. Create and activate a Python virtual environment in that directory.\n\n    ```\n    $ python3 -m venv venv\n    ```\n\n    ```\n    (venv) $ source venv/bin/activate\n    ```\n\n3. Install `pagure-exporter` using `pip` in the activated virtual environment.\n\n    ```\n    (venv) $ pip install pagure-exporter\n    ```\n\n    Sample output\n\n    ```\n    Requirement already satisfied: pagure-exporter in ./venv/lib/python3.12/site-packages (0.1.0)\n    Requirement already satisfied: GitPython<4.0.0,>=3.1.37 in ./venv/lib/python3.12/site-packages (from pagure-exporter) (3.1.40)\n    Requirement already satisfied: click<9.0.0,>=8.1.3 in ./venv/lib/python3.12/site-packages (from pagure-exporter) (8.1.7)\n    Requirement already satisfied: requests<3.0.0,>=2.31.0 in ./venv/lib/python3.12/site-packages (from pagure-exporter) (2.31.0)\n    Requirement already satisfied: tqdm<5.0.0,>=4.64.1 in ./venv/lib/python3.12/site-packages (from pagure-exporter) (4.66.1)\n    Requirement already satisfied: gitdb<5,>=4.0.1 in ./venv/lib/python3.12/site-packages (from GitPython<4.0.0,>=3.1.37->pagure-exporter) (4.0.10)\n    Requirement already satisfied: charset-normalizer<4,>=2 in ./venv/lib64/python3.12/site-packages (from requests<3.0.0,>=2.31.0->pagure-exporter) (3.3.0)\n    Requirement already satisfied: idna<4,>=2.5 in ./venv/lib/python3.12/site-packages (from requests<3.0.0,>=2.31.0->pagure-exporter) (3.4)\n    Requirement already satisfied: urllib3<3,>=1.21.1 in ./venv/lib/python3.12/site-packages (from requests<3.0.0,>=2.31.0->pagure-exporter) (2.0.7)\n    Requirement already satisfied: certifi>=2017.4.17 in ./venv/lib/python3.12/site-packages (from requests<3.0.0,>=2.31.0->pagure-exporter) (2023.7.22)\n    Requirement already satisfied: smmap<6,>=3.0.1 in ./venv/lib/python3.12/site-packages (from gitdb<5,>=4.0.1->GitPython<4.0.0,>=3.1.37->pagure-exporter) (5.0.1)\n    ```\n\n### From source\n\n1. Ensure that you have `git`, `python3` and `poetry` installed.\n\n    ```\n    $ sudo dnf install git python3 poetry --setopt=install_weak_deps=False\n    ```\n\n2. Clone the repository to the local storage and make it the present working directory.\n\n    ```\n    $ git clone https://github.com/gridhead/pagure-exporter.git\n    ```\n\n    ```\n    $ cd pagure-exporter\n    ```\n\n    Sample output\n\n    ```\n    Cloning into 'pagure-exporter'...\n    remote: Enumerating objects: 118, done.\n    remote: Counting objects: 100% (118/118), done.\n    remote: Compressing objects: 100% (78/78), done.\n    remote: Total 118 (delta 48), reused 94 (delta 31), pack-reused 0\n    Receiving objects: 100% (118/118), 56.38 KiB | 4.34 MiB/s, done.\n    Resolving deltas: 100% (48/48), done.\n    ```\n\n3. Create and activate a Python virtual environment in that directory.\n\n    ```\n    $ python3 -m venv venv\n    ```\n\n    ```\n    (venv) $ source venv/bin/activate\n    ```\n\n4. Check the project configuration's validity and then install the project dependencies.\n\n    ```\n    (venv) $ poetry check\n    ```\n\n    ```\n    (venv) $ poetry install\n    ```\n\n    Sample output\n\n    ```\n    All set!\n    ```\n\n    ```\n    Installing dependencies from lock file\n\n    Package operations: 19 installs, 0 updates, 0 removals\n\n      \u2022 Installing smmap (5.0.0)\n      \u2022 Installing certifi (2022.12.7)\n      \u2022 Installing charset-normalizer (3.0.1)\n      \u2022 Installing click (8.1.3)\n      \u2022 Installing gitdb (4.0.10)\n      \u2022 Installing idna (3.4)\n      \u2022 Installing mccabe (0.6.1)\n      \u2022 Installing mypy-extensions (0.4.3)\n      \u2022 Installing pathspec (0.11.0)\n      \u2022 Installing platformdirs (2.6.2)\n      \u2022 Installing pycodestyle (2.8.0)\n      \u2022 Installing pyflakes (2.4.0)\n      \u2022 Installing urllib3 (1.26.14)\n      \u2022 Installing black (22.12.0)\n      \u2022 Installing flake8 (4.0.1)\n      \u2022 Installing gitpython (3.1.30)\n      \u2022 Installing isort (5.12.0)\n      \u2022 Installing requests (2.28.2)\n      \u2022 Installing tqdm (4.64.1)\n\n    Installing the current project: pagure-exporter (0.1.0)\n    ```\n\n## Usage\n\n### Setup\n\n1. Using an internet browser of your choice, open up [**Pagure**](https://pagure.io) and login to your account.\n\n    ![](https://raw.githubusercontent.com/gridhead/pagure-exporter/main/data/01.png)\n\n2. Click on your profile display picture and then, head over to the [**Account Settings**](https://pagure.io/settings) page.\n\n    ![](https://raw.githubusercontent.com/gridhead/pagure-exporter/main/data/02.png)\n\n3. Under the [**API Keys**](https://pagure.io/settings#nav-api-tab) section, click on the [**Create new API key**](https://pagure.io/settings/token/new) button in the top right corner.\n\n    ![](https://raw.githubusercontent.com/gridhead/pagure-exporter/main/data/03.png)\n\n4. As this is the source namespace, check all the ACLs that are required to read the asset information associated with a repository, set a safe expiration date for the API token and write an appropriate description for its usage before clicking on the [**Create**](#) button.\n\n    ![](https://raw.githubusercontent.com/gridhead/pagure-exporter/main/data/04.png)\n\n5. Make note of the API token generated and ensure that they are not shared with others or used for a different purpose.\n\n    ![](https://raw.githubusercontent.com/gridhead/pagure-exporter/main/data/05.png)\n\n6. Head over to a repository that the currently logged-in username has at least a READ access to.\n\n    ![](https://raw.githubusercontent.com/gridhead/pagure-exporter/main/data/06.png)\n\n7. Make note of the source namespace in the format of `HOLDER/REPONAME` where the `HOLDER` can be a group or a sole user.\n   For example, in case of a repository located at `https://pagure.io/fedora-infra/ansible` - the source namespace would be `fedora-infra/ansible`.\n\n    ![](https://raw.githubusercontent.com/gridhead/pagure-exporter/main/data/07.png)\n\n8. In another internet browser tab or window, open up [**GitLab**](https://gitlab.com/) and login to your account.\n\n    ![](https://raw.githubusercontent.com/gridhead/pagure-exporter/main/data/08.png)\n\n9. Click on the [**New project/repository**](https://gitlab.com/projects/new) option from the sidebar of the profile page and then, click on the [**Create blank project**](https://gitlab.com/projects/new#blank_project) option.\n\n    ![](https://raw.githubusercontent.com/gridhead/pagure-exporter/main/data/09.png)\n\n10. Create a new empty repository which will act as the destination for the asset transfer. It is recommended to have the same name as the source namespace to avoid confusion, but it is not strictly required.\n\n    ![](https://raw.githubusercontent.com/gridhead/pagure-exporter/main/data/10.png)\n\n11. Head over to the created repository and make note of the **Project ID**.\n    For example in this case, it is `42823949` for the destination repository named `gridhead/pagure-exporter-test`.\n\n    ![](https://raw.githubusercontent.com/gridhead/pagure-exporter/main/data/11.png)\n\n12. Expand the sidebar to head over to the [**Repository**](#) section from the [**Settings**](#) section.\n\n    ![](https://raw.githubusercontent.com/gridhead/pagure-exporter/main/data/17.png)\n\n13. In the [**Protected Branches**](#) section, turn off all existing *branch protection rules* and *allow force pushing* to all branches temporarily to allow for the repository assets to be moved in here.\n\n    ![](https://raw.githubusercontent.com/gridhead/pagure-exporter/main/data/18.png)\n\n14. Expand the sidebar to head over to the [**Access Tokens**](#) section from the [**Settings**](#) section.\n\n    ![](https://raw.githubusercontent.com/gridhead/pagure-exporter/main/data/12.png)\n\n15. In the [**Project Access Token**](#) page, click on the [**Add new token**](#) button to begin creating a new access token.\n\n    ![](https://raw.githubusercontent.com/gridhead/pagure-exporter/main/data/13.png)\n\n16. As this is the destination namespace, check all the scopes that are required to write the asset information associated with a repository, pick an appropriate role, set a safe expiration date and write an appropriate description for its usage before clicking on the [**Create project access token**](#) button.\n\n    ![](https://raw.githubusercontent.com/gridhead/pagure-exporter/main/data/14.png)\n\n17. Make note of the API token generated and ensure that they are not shared with others or used for a different purpose.\n\n    ![](https://raw.githubusercontent.com/gridhead/pagure-exporter/main/data/15.png)\n\n18. Ensure that you have the following information handy before proceeding to the next steps.\n\n    1. Username of an account that has at least the READ permissions in the source namespace on Pagure (Say `srceuser`)\n    2. Access token belonging to the aforementioned account with appropriate ACLs checked required for at least the READ permissions in the source namespace (Say `srcecode`)\n    3. Name of the source namespace in the format `HOLDER/REPONAME` where the `HOLDER` can be a group or a sole user (Say `srcerepo`)\n    4. Username of an account that has at least the WRITE permissions in the destination namespace on GitLab (Say `destuser`)\n    5. Access token belonging to that aforementioned account appropriate roles and scopes required for at least the WRITE permissions in the destination namespace (Say `destcode`)\n    6. Name of the destination namespace in the format of uniquely identifiable `PROJECTID` string (Say `destrepo`)\n\n## Operate\n\n### View help menu\n\n1. Check the current version of the installed project as well as the usage information.\n\n    ```\n    (venv) $ pagure-exporter --version\n    ```\n\n    ```\n    (venv) $ pagure-exporter --help\n    ```\n\n    Sample output\n\n    ```\n    Pagure Exporter by Akashdeep Dhar <t0xic0der@fedoraproject.org>, version 0.1.0\n    ```\n\n    ```\n    Usage: pagure-exporter [OPTIONS] COMMAND [ARGS]...\n\n    Options:\n      -s, --srce TEXT  Source namespace for importing assets from  [required]\n      -d, --dest TEXT  Destination namespace for exporting assets to  [required]\n      -p, --pkey TEXT  Pagure API key for accessing the source namespace\n                       [required]\n      -g, --gkey TEXT  GitLab API key for accessing the destination namespace\n                       [required]\n      -f, --fusr TEXT  Username of the account that owns the Pagure API key\n                       [required]\n      -t, --tusr TEXT  Username of the account that owns the GitLab API key\n                       [required]\n      --version        Show the version and exit.\n      --help           Show this message and exit.\n\n    Commands:\n      repo  Initialize transfer of repository assets\n      tkts  Initiate transfer of issue tickets\n    ```\n\n2. Check the usage information of the available subcommands.\n\n    ```\n    (venv) $ pagure-exporter -s a -d a -p a -g a -f a -t a repo --help\n    ```\n\n    ```\n    (venv) $ pagure-exporter -s a -d a -p a -g a -f a -t a tkts --help\n    ```\n\n    Sample output\n\n    ```\n    Usage: pagure-exporter repo [OPTIONS]\n\n      Initialize transfer of repository assets\n\n    Options:\n      -b, --brcs TEXT  List of branches to extract\n      --help           Show this message and exit.\n    ```\n\n    ```\n    Usage: pagure-exporter tkts [OPTIONS]\n\n      Initiate transfer of issue tickets\n\n    Options:\n      -s, --status [OPEN|SHUT|FULL]  Extract issue tickets of the mentioned status\n                                     [default: OPEN]\n      -r, --ranges TEXT...           Extract issue tickets in the mentioned ranges\n      -p, --select TEXT              Extract issue tickets of the selected numbers\n      -c, --comments                 Transfer all the associated comments\n      -l, --labels                   Migrate all the associated labels\n      -a, --commit                   Assert issue ticket states as they were\n      -t, --secret                   Confirm issue ticket privacy as they were\n      --help                         Show this message and exit.\n    ```\n\n### Migrate repository files\n\n1. Ensure that the location where the project repository was cloned is the present working directory and that the previously populated virtual environment is enabled.\n\n    ```\n    $ cd pagure-exporter\n    ```\n\n    ```\n    $ source venv/bin/activate\n    ```\n\n2. Using an internet browser of your choice, visit the source namespace repository page on Pagure to pick the branches that you wish to transfer.\n\n    ![](https://raw.githubusercontent.com/gridhead/pagure-exporter/main/data/16.png)\n\n3. Execute the following command to begin migrating the repository assets from the source namespace on Pagure to the destination namespace on GitLab.\n\n    1. If only a set of branches are to be migrated\n\n        ```\n        (venv) $ pagure-exporter \\\n                 --fusr srceuser --pkey srcecode --srce srcerepo \\\n                 --tusr destuser --gkey destcode --dest destrepo \\\n                 repo \\\n                 --brcs brca,brcb,brcc,brcd\n        ```\n\n        For a set of branches available in the source namespace named `brca`, `brcb`, `brcc` and `brcd` to be migrated to the destination namespace.\n\n    2. If all the available branches are to be migrated\n\n        ```\n        (venv) $ pagure-exporter \\\n                 --fusr srceuser --pkey srcecode --srce srcerepo \\\n                 --tusr destuser --gkey destcode --dest destrepo \\\n                 repo\n        ```\n\n       This is the default behaviour of the subcommand so if no branch names are provided, all the branches from the source namespace are migrated\n\n4. If there are any contents available in the branches of the destination namespace, they will be overwritten by the contents from the branches migrated from the source namespace.\n\n### Migrate issue tickets\n\n1. Ensure that the location where the project repository was cloned is the present working directory and that the previously populated virtual environment is enabled.\n\n    ```\n    $ cd pagure-exporter\n    ```\n\n    ```\n    $ source venv/bin/activate\n    ```\n\n2. Execute the following command to begin extracting the issue tickets from the source namespace on Pagure to the destination namespace.\n\n   1. If the issue tickets of a certain status need to be transferred.\n\n      ```\n      (venv) $ pagure-exporter \\\n                 --fusr srceuser --pkey srcecode --srce srcerepo \\\n                 --tusr destuser --gkey destcode --dest destrepo \\\n                 tkts \\\n                 --status open\n      ```\n\n   2. If the comments associated with the issue tickets need to be transferred.\n\n      ```\n      (venv) $ pagure-exporter \\\n                 --fusr srceuser --pkey srcecode --srce srcerepo \\\n                 --tusr destuser --gkey destcode --dest destrepo \\\n                 tkts \\\n                 --comments\n      ```\n\n   3. If the labels associated with the issue tickets need to be transferred.\n\n      ```\n      (venv) $ pagure-exporter \\\n                 --fusr srceuser --pkey srcecode --srce srcerepo \\\n                 --tusr destuser --gkey destcode --dest destrepo \\\n                 tkts \\\n                 --labels\n      ```\n\n   4. If the states associated with the issue tickets need to be transferred.\n\n      ```\n      (venv) $ pagure-exporter \\\n                 --fusr srceuser --pkey srcecode --srce srcerepo \\\n                 --tusr destuser --gkey destcode --dest destrepo \\\n                 tkts \\\n                 --commit\n      ```\n\n   5. If the privacy associated with the issue tickets need to be transferred.\n\n      ```\n      (venv) $ pagure-exporter \\\n                 --fusr srceuser --pkey srcecode --srce srcerepo \\\n                 --tusr destuser --gkey destcode --dest destrepo \\\n                 tkts \\\n                 --secret\n      ```\n\n   6. If the issue tickets from a range of issue identities need to be transferred.\n\n      ```\n      (venv) $ pagure-exporter \\\n                 --fusr srceuser --pkey srcecode --srce srcerepo \\\n                 --tusr destuser --gkey destcode --dest destrepo \\\n                 tkts \\\n                 --ranges STRT STOP\n      ```\n\n      Issue tickets with identities `STRT`, `STRT+1` ... `STOP-1`, `STOP` would be considered here.\n\n   7. If the issue tickets that need to be considered need to be cherry-picked.\n\n      ```\n      (venv) $ pagure-exporter \\\n                 --fusr srceuser --pkey srcecode --srce srcerepo \\\n                 --tusr destuser --gkey destcode --dest destrepo \\\n                 tkts \\\n                 --select NUM1,NUM2,NUM3 ...\n      ```\n\n      Issue tickets with identities `NUM1`, `NUM2`, `NUM3` ... would be considered here.\n\n   While these options can be mixed and matched to be used together, the options `--ranges` and `--select` cannot be used at the same time as they perform identical functions.\n\n   For example,\n\n      1. The following command will migrate all issue tickets, the identities of which fall between the range of `STRT` and `STOP` both included, with status `OPEN` along with the associated comments, labels and privacy.\n\n         ```\n         (venv) $ pagure-exporter \\\n                    --fusr srceuser --pkey srcecode --srce srcerepo \\\n                    --tusr destuser --gkey destcode --dest destrepo \\\n                    tkts \\\n                    --status open \\\n                    --comments \\\n                    --labels \\\n                    --secret \\\n                    --ranges STRT STOP\n         ```\n\n      2. The following command will migrate all issue tickets with the identities `NUM1`, `NUM2`, `NUM3` ... with status `SHUT` along with the associated labels, states and privacy.\n\n         ```\n         (venv) $ pagure-exporter \\\n                    --fusr srceuser --pkey srcecode --srce srcerepo \\\n                    --tusr destuser --gkey destcode --dest destrepo \\\n                    tkts \\\n                    --status shut \\\n                    --labels \\\n                    --commit \\\n                    --secret \\\n                    --select NUM1,NUM2,NUM3 ...\n         ```\n",
    "bugtrack_url": null,
    "license": "GPL-3.0-or-later",
    "summary": "Simple exporter tool that helps migrate repository files, data assets and issue tickets from projects on Pagure to GitLab",
    "version": "0.1.3",
    "project_urls": {
        "Documentation": "https://github.com/gridhead/pagure-exporter/blob/main/README.md",
        "Homepage": "https://github.com/gridhead/pagure-exporter",
        "Repository": "https://github.com/gridhead/pagure-exporter"
    },
    "split_keywords": [
        "fedora",
        "pagure",
        "gitlab"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0757e1b11492e6f29b420b2d6a654a71c7ebbc16139148f16f70e6095fbcfe7e",
                "md5": "af2afbfadb57f4ac04c8174df8e558fe",
                "sha256": "4b6dca78bd4210944830b4ff5c17e6dea88b311db558fdea6196a368cb3cdf27"
            },
            "downloads": -1,
            "filename": "pagure_exporter-0.1.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "af2afbfadb57f4ac04c8174df8e558fe",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11,<4.0",
            "size": 39405,
            "upload_time": "2024-03-12T03:37:43",
            "upload_time_iso_8601": "2024-03-12T03:37:43.095732Z",
            "url": "https://files.pythonhosted.org/packages/07/57/e1b11492e6f29b420b2d6a654a71c7ebbc16139148f16f70e6095fbcfe7e/pagure_exporter-0.1.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5cc75d68bb3ac7e33d982bf8f547e367c60632c4cb372cb9ed97c3508d700b43",
                "md5": "147d88575339ee4864bcb8a342dddf4b",
                "sha256": "4787e999508d2eca715d0a558eee63708d3dc9af66b699d873b8818b6d2c1def"
            },
            "downloads": -1,
            "filename": "pagure_exporter-0.1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "147d88575339ee4864bcb8a342dddf4b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11,<4.0",
            "size": 32108,
            "upload_time": "2024-03-12T03:37:45",
            "upload_time_iso_8601": "2024-03-12T03:37:45.382432Z",
            "url": "https://files.pythonhosted.org/packages/5c/c7/5d68bb3ac7e33d982bf8f547e367c60632c4cb372cb9ed97c3508d700b43/pagure_exporter-0.1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-12 03:37:45",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "gridhead",
    "github_project": "pagure-exporter",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "pagure-exporter"
}
        
Elapsed time: 3.20616s