# Migration steps

{% hint style="success" %}
This is the official documentation of the `agent_ruby` Ruby agent.
{% endhint %}

### Step 1: Remove the previous agent

#### Settings

{% hint style="warning" %}
Please keep your `FOREST_ENV_SECRET` before deleting the old agent. You will need it to configure the new one. You can find it in you `config/secrets.yml` file.
{% endhint %}

```bash
# uninstall the old agent
bundle remove forest_liana
# remove the old configuration files
rm -f config/initializers/forest_liana.rb
rm -f config/secrets.yml
```

#### Route configuration

Remove the 'ForestLiana' route from your `config/routes.rb` file.

```ruby
# remove this line
mount ForestLiana::Engine => '/forest'
```

#### Cache

The previous agent required cache to be activated in development mode. This is no longer necessary with the new agent. You can disable it with the following command:

```bash
rails dev:cache
```

### Step 2: Install the new agent

add the following line to your Gemfile:

```ruby
gem "forest_admin_rails", "~> 1.0.0"
gem "forest_admin_agent", "~> 1.0.0"
gem "forest_admin_datasource_toolkit", "~> 1.0.0"
gem "forest_admin_datasource_active_record", "~> 1.0.0"
gem "forest_admin_datasource_customizer", "~> 1.0.0"
```

Then run:

```bash
rails g forest_admin_rails:install FOREST_ENV_SECRET
```

### Step 3: Customization

Previously, to customize a SmartAction, you set it for each model `lib/forest_liana/collections/` and `app/controllers/forest/` directories. Now, you set it in the `lib/forest_admin_rails/create_agent.rb` file. You will find more information in the [dedicated section](https://docs.forestadmin.com/developer-guide-agents-ruby/agent-customization/agent-customization) on moving your previous SmartAction customizations to the new agent.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.forestadmin.com/developer-guide-agents-ruby/getting-started/migrating/steps.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
