# Migration to new agent: SQL segments no longer active

**URL:** <https://community.forestadmin.com/t/migration-to-new-agent-sql-segments-no-longer-active/7316>\
**Category:** Help me!\
**Created:** [July 9, 2024, 10:51am UTC](https://community.forestadmin.com/t/migration-to-new-agent-sql-segments-no-longer-active/7316 "2024-07-09T10:51:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kll](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/kll/32/7091_2.png) [@kll](https://community.forestadmin.com/u/kll)\
**Post date:** [July 9, 2024, 10:51am UTC](https://community.forestadmin.com/t/migration-to-new-agent-sql-segments-no-longer-active/7316/1 "2024-07-09T10:51:40Z")

</div>

## Feature(s) impacted

Smart segments defined on the old agent via a SQL query.

## Observed behavior

Filtering no longer takes place on the collection despite the request being shown.

## Expected behavior

Segments should continue to work as migrating them was not explicitly indicated.

## Failure Logs

From what I understand in this post, this is expected:

> [@SQL not available in segment filtering](https://community.forestadmin.com/t/sql-not-available-in-segment-filtering/6689/2):
>
> Hello @vit, This feature is not compatible with @forestadmin/agent at the moment. You can either use the filters that are displayed in the UI, or create a [segment directly in the code](https://docs.forestadmin.com/developer-guide-agents-nodejs/agent-customization/segments), where you have full control of the requested elements. I’ll add this feedback to our product board in order to have it prioritized.

This was a disagreeable surprise as I tried to follow the docs carefully.  
[Smart Segments | Node.js Developer Guide (forestadmin.com)](https://docs.forestadmin.com/developer-guide-agents-nodejs/getting-started/migrating/steps/code-transformations/smart-segments)  
This page says nothing about segments defined from the UI. It is the only page that mentions segments on code migrations.

I fail to see how I could have known this before running the migration and realizing that my segments are broken. Did I miss some documentation somewhere?

If not, please add a page on [Code transformations | Node.js Developer Guide (forestadmin.com)](https://docs.forestadmin.com/developer-guide-agents-nodejs/getting-started/migrating/steps/code-transformations) for future users to be aware that this has to be done.

## Context

- Agent technology: nodejs
- Agent (forest package) name & version: 1.40.1 with sequelize 6.37.3 and sequelize-typescript 2.1.6
- Database type: MSSQL
- Recent changes made on your end if any: Migrating from old agent.

---

<div class="post-metadata">

**Author:** ![anon7284711](https://avatars.discourse-cdn.com/v4/letter/a/ac8455/32.png) [@anon7284711](https://community.forestadmin.com/u/anon7284711)\
**Post date:** [July 9, 2024, 2:09pm UTC](https://community.forestadmin.com/t/migration-to-new-agent-sql-segments-no-longer-active/7316/2 "2024-07-09T14:09:48Z")

</div>

Hello @kll,

Thanks for the report, as you’ve seen from the other post, the `@forestadmin/agent` does not allow the creation of SQL segments via the UI.

It should have been added to the list of [missing features](https://docs.forestadmin.com/developer-guide-agents-nodejs/getting-started/migrating#missing-features) in the Migration guide. Sorry for the inconvenience this has caused.

I’ll update the page to reflect this.

Best regards,

---

<div class="post-metadata">

**Author:** ![kll](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/kll/32/7091_2.png) [@kll](https://community.forestadmin.com/u/kll)\
**Post date:** [July 9, 2024, 2:12pm UTC](https://community.forestadmin.com/t/migration-to-new-agent-sql-segments-no-longer-active/7316/3 "2024-07-09T14:12:40Z")

</div>

Thanks for the quick reply! In the meantime I did port all my segments through code so it’s not a huge deal, I just wish I knew before discovering it in prod 😛

---

<div class="post-metadata">

**Author:** ![anon7284711](https://avatars.discourse-cdn.com/v4/letter/a/ac8455/32.png) [@anon7284711](https://community.forestadmin.com/u/anon7284711)\
**Post date:** [July 9, 2024, 3:19pm UTC](https://community.forestadmin.com/t/migration-to-new-agent-sql-segments-no-longer-active/7316/4 "2024-07-09T15:19:57Z")

</div>

For sure, it’s not always a good thing to discover surprises after the migration has started ! 🫢

The documentation with the [updated section](https://docs.forestadmin.com/developer-guide-agents-nodejs/getting-started/migrating#segments) is live 🙂
