---
owner_slack: "#govuk-2ndline"
title: Edit an existing route in the Router
section: Routing
layout: manual_layout
parent: "/manual.html"
last_reviewed_on: 2018-04-12
review_in: 6 months
---

The Router API database is populated from the Publishing API, and also
the deprecated router-data tool. Changes to routes should be made in
the Publishing API as this is the authoritative source of the data,
however, it can be helpful to make short term changes to routes
manually, when going through the Publishing API would take too long,
for example during an incident.

If there's a need to edit a route in the database, follow these
instructions:

    $ ssh router-backend-1.router.production
    $ govuk_app_console router-api
    > r = Route.where(incoming_path: '/path-to-item').first

Manipulate the `r` object directly (see the
[documentation](https://github.com/alphagov/router#data-structure) for
available options), eg:

    > r.route_type = 'exact'
    > r.save!

Once you've edited the Route appropriately and saved it, you need to
reload the router:

    > RouterReloader.reload

---
owner_slack: "#govuk-2ndline"
title: Edit an existing route in the Router
section: Routing
layout: manual_layout
parent: "/manual.html"
last_reviewed_on: 2018-09-06
review_in: 6 months
---

The Router API database is populated from the Publishing API, and also
the deprecated router-data tool. Changes to routes should be made in
the Publishing API as this is the authoritative source of the data,
however, it can be helpful to make short term changes to routes
manually, when going through the Publishing API would take too long,
for example during an incident.

If there's a need to edit a route in the database:

1. Connect to a router-backend machine

```console
ssh router-backend-1.router.production
```

in Carrenza, and

```console
govukcli set-context integration
govukcli ssh router_backend
```

in AWS.

2. Connect to router-api and get the route

```console
govuk_app_console router-api
> r = Route.where(incoming_path: '/path-to-item').first
```

3. Manipulate the `r` object directly (see the
[documentation](https://github.com/alphagov/router#data-structure) for
available options), for example:

```console
> r.route_type = 'exact'
> r.save!
```

4. Once you've edited the route appropriately and saved it, reload the router

```console
> RouterReloader.reload
```

Update edit an existing route docs
Update edit an existing route docs

This commit adds instructions for AWS.