# Imported categories are not in parent category

**URL:** https://meta.discourse.org/t/imported-categories-are-not-in-parent-category/387858
**Category:** Support
**Tags:** categories, spaces
**Created:** [7 בנובמבר,‏ 2025,‏ 11:26am UTC](https://meta.discourse.org/t/imported-categories-are-not-in-parent-category/387858 "2025-11-07T11:26:37Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![AudeF](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/audef/32/292465_2.png) [@AudeF](https://meta.discourse.org/u/AudeF)
#### Post date: [7 בנובמבר,‏ 2025,‏ 11:26am UTC](https://meta.discourse.org/t/imported-categories-are-not-in-parent-category/387858/1 "2025-11-07T11:26:37Z")

</div>

Hi all!

I’m trying to duplicate the structure of a category (copy all sub-categories from the previous version 26 to new version 27).

What I’m doing :

- I create my new category 27, and note its id
- I export a json with command _discourse export\_category 26_
- I edit the json file to keep only categories, I change the slugs to keep them unique, …
- for each sub-category, I set “parent\_category\_id”: new category id

I then import my edited json with _discourse import\_category file.json_

My sub-categories are then imported but NOT in my new category, they have no parent.

What is the right way to import in a category?

---

<div class="post-metadata">

### Author: ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)
#### Post date: [7 בנובמבר,‏ 2025,‏ 11:39am UTC](https://meta.discourse.org/t/imported-categories-are-not-in-parent-category/387858/2 "2025-11-07T11:39:53Z")

</div>

Does setting the parent in the category settings work?

---

<div class="post-metadata">

### Author: ![AudeF](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/audef/32/292465_2.png) [@AudeF](https://meta.discourse.org/u/AudeF)
#### Post date: [7 בנובמבר,‏ 2025,‏ 2:00pm UTC](https://meta.discourse.org/t/imported-categories-are-not-in-parent-category/387858/3 "2025-11-07T14:00:10Z")

</div>

Yes, the manual change is OK

---

<div class="post-metadata">

### Author: ![tobiaseigen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tobiaseigen/32/539204_2.png) [@tobiaseigen](https://meta.discourse.org/u/tobiaseigen)
#### Post date: [3 בדצמבר,‏ 2025,‏ 9:21pm UTC](https://meta.discourse.org/t/imported-categories-are-not-in-parent-category/387858/4 "2025-12-03T21:21:10Z")

</div>

@AudeF would you be able to explain in some more detail what your site is about and what you’re trying to do? Why do you need to duplicate the strucuture of a category and all its subcategories?

Can you also show your work in some more detail here, eg how exactly did you export the json and then import it again?

Some time has passed since you asked so perhaps in the meantime you’ve figured some things out?

---

<div class="post-metadata">

### Author: ![AudeF](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/audef/32/292465_2.png) [@AudeF](https://meta.discourse.org/u/AudeF)
#### Post date: [5 בדצמבר,‏ 2025,‏ 8:54am UTC](https://meta.discourse.org/t/imported-categories-are-not-in-parent-category/387858/5 "2025-12-05T08:54:08Z")

</div>

Well, I’ve set the parent category manually, so it’s ok for now, but I’d like to not have to do it again next year 😅 .

We use our forum to discuss the tests of our software with external users. We have a new version each year, and we don’t want to mix new tests with older discussions, so we create a new category for each version. The sub-categories are mostly the same each time so I don’t want to create them by hand again and again 😉 .

I use this tutorial to export and import the json files: [Move topics from one Discourse instance to another](https://meta.discourse.org/t/move-topics-from-one-discourse-instance-to-another/38930) , except that I do it for the same forum so I change the slugs and ids to avoid conflicts.
