# Import\_scripts validator does not account for max\_category\_nesting \> 2

**URL:** https://meta.discourse.org/t/import-scripts-validator-does-not-account-for-max-category-nesting-2/282661
**Category:** Bug
**Created:** [October 18, 2023, 3:47pm UTC](https://meta.discourse.org/t/import-scripts-validator-does-not-account-for-max-category-nesting-2/282661 "2023-10-18T15:47:16Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![MildlyInterested](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mildlyinterested/32/334145_2.png) [@MildlyInterested](https://meta.discourse.org/u/MildlyInterested)
#### Post date: [October 18, 2023, 3:47pm UTC](https://meta.discourse.org/t/import-scripts-validator-does-not-account-for-max-category-nesting-2/282661/1 "2023-10-18T15:47:16Z")

</div>

Importing my MyBB instance into discourse instance with `SiteSetting.max_category_nesting = 3` fails with this error:

```plaintext
creating users
       66 / 330 ( 20.0%) [633 items/min] /root/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.0.7/lib/active_record/validations.rb:80:in `raise_validation_error': Validation failed: You can't nest a subcategory under another (ActiveRecord::RecordInvalid)

```

I’m guessing the validator wasn’t written with this somewhat recent change in mind.
