{"id":21012472,"url":"https://github.com/guipenedo/discourse-duplicate-category","last_synced_at":"2025-10-03T18:35:26.518Z","repository":{"id":247419754,"uuid":"341528359","full_name":"guipenedo/discourse-duplicate-category","owner":"guipenedo","description":"This simple script uses Discourse's REST API to duplicate a category, which is not possible directly through discourse's frontend.","archived":false,"fork":false,"pushed_at":"2021-04-25T16:18:33.000Z","size":40,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-20T11:31:08.685Z","etag":null,"topics":["category","copy","discourse","discourse-api","discourse-forum","duplicate"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/guipenedo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-23T11:13:39.000Z","updated_at":"2022-09-08T10:55:45.000Z","dependencies_parsed_at":"2024-07-08T18:05:39.091Z","dependency_job_id":"d65c652a-0b4c-4e08-a92e-e52706902e4e","html_url":"https://github.com/guipenedo/discourse-duplicate-category","commit_stats":null,"previous_names":["guipenedo/discourse-duplicate-category"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guipenedo%2Fdiscourse-duplicate-category","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guipenedo%2Fdiscourse-duplicate-category/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guipenedo%2Fdiscourse-duplicate-category/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guipenedo%2Fdiscourse-duplicate-category/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/guipenedo","download_url":"https://codeload.github.com/guipenedo/discourse-duplicate-category/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243437965,"owners_count":20290864,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["category","copy","discourse","discourse-api","discourse-forum","duplicate"],"created_at":"2024-11-19T09:37:07.927Z","updated_at":"2025-10-03T18:35:21.462Z","avatar_url":"https://github.com/guipenedo.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Discourse duplicate category\nThis simple script uses [Discourse's REST API](https://docs.discourse.org/) to duplicate a category, which is not possible directly through the frontend.\n\n## Features\n- Copy category colors\n- Copy category images\n- Copy category permission groups\n- Optionally replace the original permission groups with new ones directly\n- Copy category settings (wiki, subcategory display options, etc)\n- Copy category description (the auto generated about post is edited with the contents of the origin category's about post)\n- Sub categories are recursively copied\n\nUnfortunately the list of allowed tags is not copied at this time.\n\n## Obtaining an API key\n![On settings, click on API and then on the key icon to create a new API Key](media/create_api_key.png)\n\n## Configuration\nRename the `config.ini.default` file to `config.ini`.\nFill in the options:\n```ini\n[forum]\napi_key= # put your API key here\napi_user= # the username of the user associated with this API key\nurl= # Discourse installation base url, without trailing /\n```\n\n## Installation\n1. Create a [virtual environment](https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/#creating-a-virtual-environment)\n1. [Activate](https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/#activating-a-virtual-environment) it\n1. Install the requirements\n   ```shell\n   $ pip install -r requirements.txt\n   ```\n\n## Running\n1. [Activate](https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/#activating-a-virtual-environment)\n   the virtual environment you created\n1. While in the main directory, run\n   ```shell\n   python3 main.py\n   ```\n1. Choose a category to **copy from** (origin) by name\n1. Choose the name of the **new category** (destination)\n1. Choose the new category's **slug**\n1. Optionally, type in \"yes\" to indicate a group replacement mapping.\n   \n   For example, to replace *astro-studs* with *math-studs* and *astro-teach* with *math-teach*:\n   ```\n   Would you like to replace groups from the previous category with different ones, already created? (yes/no) yes\n   How many groups? 2\n   Old group 1/2: astro-studs\n   New group 1/2: math-studs\n   Old group 2/2: astro-teach\n   New group 2/2: math-teach\n   ```\n   Please note that *math-studs* and *math-teach* groups ***must already exist***.\n1. The script will now recursively duplicate the category and its subcategories\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguipenedo%2Fdiscourse-duplicate-category","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fguipenedo%2Fdiscourse-duplicate-category","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguipenedo%2Fdiscourse-duplicate-category/lists"}