You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(2.0.x, 2.1.x, 2.2.x, 2.3.x, 2.4.x, 2.5.x, 2.6.x, 2.7.x) to the version number you are currently using.
102
+
103
+
104
+
### Suggested upgrade path
105
+
106
+
**Version prerequisites for migrating to version 2.7.x**
107
+
108
+
The lowest version that Kong 2.7.x supports migrating from is 1.0.x.
109
+
If you are migrating from a version lower than 0.14.1, you need to
110
+
migrate to 0.14.1 first. Then, once you are migrating from 0.14.1,
111
+
please migrate to 1.5.x first.
112
+
113
+
The steps for upgrading from 0.14.1 to 1.5.x are the same as upgrading
114
+
from 0.14.1 to Kong 1.0. Please follow the steps described in the
115
+
"Migration Steps from 0.14" in the
116
+
117
+
[Suggested Upgrade Path for Kong 1.0](https://github.com/Kong/kong/blob/master/UPGRADE.md#kong-1-0-upgrade-path)
118
+
with the addition of the `kong migrations migrate-apis` command,
119
+
which you can use to migrate legacy `apis` configurations.
120
+
121
+
Once you migrated to 1.5.x, you can follow the instructions in the section
122
+
below to migrate to 2.7.x.
123
+
124
+
### Upgrade from `1.0.x` - `2.2.x` to `2.7.x`
125
+
126
+
**Postgres**
127
+
128
+
Kong 2.7.x supports a no-downtime migration model. This means that while the
129
+
migration is ongoing, you will have two Kong clusters running, sharing the
130
+
same database. (This is sometimes called the Blue/Green migration model.)
131
+
132
+
The migrations are designed so that the new version of Kong is able to use
133
+
the database as it is migrated while the old Kong cluster keeps working until
134
+
it is time to decommission it. For this reason, the migration is split into
135
+
two steps, performed via commands `kong migrations up` (which does
136
+
only non-destructive operations) and `kong migrations finish` (which puts the
137
+
database in the final expected state for Kong 2.7.x).
138
+
139
+
1. Download 2.7.x, and configure it to point to the same datastore
140
+
as your old (1.0 to 2.0) cluster. Run `kong migrations up`.
141
+
2. After that finishes running, both the old (2.x.x) and new (2.7.x)
142
+
clusters can now run simultaneously. Start provisioning 2.7.x nodes,
143
+
but do not use their Admin API yet. If you need to perform Admin API
144
+
requests, these should be made to the old cluster's nodes. The reason
145
+
is to prevent the new cluster from generating data that is not understood
146
+
by the old cluster.
147
+
3. Gradually divert traffic away from your old nodes, and into
148
+
your 2.7.x cluster. Monitor your traffic to make sure everything
149
+
is going smoothly.
150
+
4. When your traffic is fully migrated to the 2.7.x cluster,
151
+
decommission your old nodes.
152
+
5. From your 2.7.x cluster, run: `kong migrations finish`.
153
+
From this point on, it will not be possible to start
154
+
nodes in the old cluster pointing to the same datastore anymore. Only run
155
+
this command when you are confident that your migration
156
+
was successful. From now on, you can safely make Admin API
157
+
requests to your 2.7.x nodes.
158
+
159
+
**Cassandra**
160
+
161
+
Deprecation notice:
162
+
Cassandra as a backend database for Kong Gateway is deprecated. This means the feature will eventually be removed. Our target for Cassandra removal is the Kong Gateway 4.0 release, and some new features might not be supported with Cassandra in the Kong Gateway 3.0 release.
163
+
164
+
Due to internal changes, the table schemas used by Kong 2.7.x on Cassandra
165
+
are incompatible with those used by Kong 2.1.x (or lower). Migrating using the usual commands
166
+
`kong migrations up` and `kong migrations finish` will require a small
167
+
window of downtime, since the old and new versions cannot use the
168
+
database at the same time. Alternatively, to keep your previous version fully
169
+
operational while the new one initializes, you will need to transfer the
170
+
data to a new keyspace via a database dump, as described below:
171
+
172
+
1. Download 2.7.x, and configure it to point to a new keyspace.
173
+
Run `kong migrations bootstrap`.
174
+
2. Once that finishes running, both the old (pre-2.1) and new (2.7.x)
175
+
clusters can now run simultaneously, but the new cluster does not
176
+
have any data yet.
177
+
3. On the old cluster, run `kong config db_export`. This will create
178
+
a file `kong.yml` with a database dump.
179
+
4. Transfer the file to the new cluster and run
180
+
`kong config db_import kong.yml`. This will load the data into the new cluster.
181
+
5. Gradually divert traffic away from your old nodes, and into
182
+
your 2.7.x cluster. Monitor your traffic to make sure everything
183
+
is going smoothly.
184
+
6. When your traffic is fully migrated to the 2.7.x cluster,
185
+
decommission your old nodes.
186
+
187
+
### Installing 2.7.x on a fresh datastore
188
+
189
+
The following commands should be used to prepare a new 2.7.x cluster from a
190
+
fresh datastore. By default the `kong` CLI tool will load the configuration
191
+
from `/etc/kong/kong.conf`, but you can optionally use the flag `-c` to
192
+
indicate the path to your configuration file:
193
+
194
+
```
195
+
$ kong migrations bootstrap [-c /path/to/your/kong.conf]
196
+
$ kong start [-c /path/to/your/kong.conf]
197
+
```
198
+
Unless indicated otherwise in one of the upgrade paths of this document, it is
199
+
possible to upgrade Kong **without downtime**.
200
+
201
+
Assuming that Kong is already running on your system, acquire the latest
202
+
version from any of the available [installation methods](https://getkong.org/install/)
203
+
and proceed to install it, overriding your previous installation.
204
+
205
+
**If you are planning to make modifications to your configuration, this is a
206
+
good time to do so**.
207
+
208
+
Then, run migration to upgrade your database schema:
209
+
210
+
```shell
211
+
$ kong migrations up [-c configuration_file]
212
+
```
213
+
214
+
If the command is successful, and no migration ran
0 commit comments