Upgrading Influx 1.8.10 to Influx 2.x

Hi all,

So day has come to upgrade my entire influx environment. As always read the documentation and getting ready. Made back ups and getting ready to go.

Current version:

$ influx -version
$ InfluxDB shell version: 1.8.10

Ok so then as per Automatically upgrade from InfluxDB 1.x to 2.1 lets run →

influxd upgrade

Interesting:

unknown command "upgrade"
Run 'influxd help' for usage

Ok lets check help:

Usage of influx:
  -version
                        Display the version and exit.
  -path-prefix 'url path'
                        Path that follows the host and port
  -host 'host name'
                        Host to connect to.
  -port 'port #'
                        Port to connect to.
  -socket 'unix domain socket'
                        Unix socket to connect to.
  -database 'database name'
                        Database to connect to the server.
  -password 'password'
                        Password to connect to the server.  Leaving blank will prompt for password (--password '').
  -username 'username'
                        Username to connect to the server.
  -ssl
                        Use https for requests.
  -unsafeSsl
                        Set this when connecting to the cluster using https and not use SSL verification.
  -execute 'command'
                        Execute command and quit.
  -type 'influxql|flux'
                        Type specifies the query language for executing commands or when invoking the REPL.
  -format 'json|csv|column'
                        Format specifies the format of the server responses:  json, csv, or column.
  -precision 'rfc3339|h|m|s|ms|u|ns'
                        Precision specifies the format of the timestamp:  rfc3339, h, m, s, ms, u or ns.
  -consistency 'any|one|quorum|all'
                        Set write consistency level: any, one, quorum, or all
  -pretty
                        Turns on pretty print for the json format.
  -import
                        Import a previous database export from file
  -pps
                        How many points per second the import will allow.  By default it is zero and will not throttle importing.
  -path
                        Path to file to import
  -compressed
                        Set to true if the import file is compressed

Examples:

    # Use influx in a non-interactive mode to query the database "metrics" and pretty print json:
    $ influx -database 'metrics' -execute 'select * from cpu' -format 'json' -pretty

    # Connect to a specific database on startup and set database context:
    $ influx -database 'metrics' -host 'localhost' -port '8086'

No upgrade command. Am I missing something very basic here?

You run influxd binary from version 1. Upgrade command is part of influxd of version 2.

Thank you for the response so I need to upgrade to influxd version 2?

Definitely. If you want to upgrade to InfluxDB 2, you need to install it first. Both versions can co-exist. Data are copied during the upgrade process. However, both share the same default port 8086, so they cannot run at the same time.

Thank you once again I’ll install the V2 of that binary shit down the v1 and try the upgrade.

Question how does one install the V2 of the binary on Ubuntu you have a link?

I have tried to look for the “V2” version of the binary but cant find the install. Would you mind pointing me in the direction for it?

It is not so hard to find it: Downloads

Thank you @VlastaHajek

Please just humor me here. So I do:

$ sudo apt remove influxdb

It removes influxdb I then do:

wget https://dl.influxdata.com/influxdb/releases/influxdb_1.8.10_amd64.deb
sudo dpkg -i influxdb_1.8.10_amd64.deb

It installs influxdb, I then do an

influx -help

Same output no update command same commands options as previously. On the downloads page you supplied I installed the only 1.x version that is available: v1.8.10 so not sure what other binaries there are?

If I run a influxd version I get

 influxd version
InfluxDB v1.8.10 (git: 1.8 688e697c51fd)

$ sudo apt remove influxdb

Okay, so you’ve just uninstalled InfluxDB 1.8

then do:

wget https://dl.influxdata.com/influxdb/releases/influxdb_1.8.10_amd64.deb

That downloads InfluxDB 1.8

sudo dpkg -i influxdb_1.8.10_amd64.deb

That installs InfluxDB 1.8 again.

influx -help

Same output no update command same commands options as previously.

Well, indeed - update is a v2 command, not available in v1.8

On the downloads page you supplied I installed the only 1.x version that is
available: v1.8.10 so not sure what other binaries there are?

I don’t understand.

Do you see “InfluxDB 2.x Open Source Time Series Database” towards the top of
Downloads and is that what you are downloading?

Antony.

Ok so I am trying to get the right Influx 1.8.x binary that has the “update” command. I am trying to do a in place upgrade from 1.8.10 to 2.x

I dont want to lose the current data I have.

Above the indication was that I had the wrong influx 1.8 binary and the update command was missing. Therefore the suggestion to install the correct binary from the download link, which I was doing. However after removing and reinstalling even though the remove and reinstall was successful it was not updating the binary with the “right one” which would allow me to run - $ influx update.

Well, indeed - update is a v2 command, not available in v1.8

Ok but the documentation says from your influx 1.8 install you run influx upgrade which then upgrades it to influx 2.x

In the documentation

Use the influxd upgrade command to upgrade InfluxDB 1.x to InfluxDB 2.1. The upgrade command provides an in-place upgrade from InfluxDB 1.x to InfluxDB 2.1.

Unless I am reading this all wrong and I need to install influx 2.x first on the same machine, shutdown. / Stop the 1.8 instance and do a influx upgrade and it will use the influx 2.0 binary to upgrade???

Ok so I am trying to get the right Influx 1.8.x binary that has the
“update” command.

1.8 does not have the update command.

I am trying to do a in place upgrade from 1.8.10 to 2.x

So:

  1. Install 2.x

  2. Perform the update

I dont want to lose the current data I have.

Take a backup, if you don’t already have these simply as a matter of course?

Antony.

Thank you!

Yes I made a backup of all the data and other files.

Just so I understand:
I uninstall 1.8.10
I install 2.x
Do upgrade OR

I just install influx 2.0 along side 1.8 and then do the $ influx upgrade command?

Thank you!

Yes I made a backup of all the data and other files.

Excellent.

I just install influx 2.0 along side 1.8 and then do the $ influx upgrade
command?

Right.

tells you that the upgrade process “Reads the existing InfluxDB 1.x
configuration file”.

I strongly recommend you read the instructions under “Perform the upgrade” at

Step 1 is to “Download InfluxDB OSS 2.1.”

Step 2 is to “Stop your running InfluxDB 1.x instance.”

That confirms that you should not uninstall version 1 before doing the upgrade.

Antony.

@Pooh excellent thank you for taking the time to explain. That now all makes sense to me. Thank you once again.

Let me go start the upgrade and then change a bunch of dashboards now :blush:

A quick question on the upgrade. Did the upgrade output spent a long time upgrading. (I have large amounts of data) at the end all was successful.

Hit the influx local website, go look at buckets none of my 1.8.x databases are there. My understanding was that the upgrade process would migrate the databases to buckets so I don’t lose the data?

A quick question on the upgrade.
Did the upgrade output spent a long time upgrading.

Sorry, don’t understand that question. (Is it a question? No “?” at the
end.)

(I have large amounts of data) at the end all was successful.

Good to hear that all was successful.

Hit the influx local website, go look at buckets none of my 1.8.x databases
are there.

Please explain how you checked - tell us the commands you used to find out.

My understanding was that the upgrade process would migrate the databases to
buckets so I don’t lose the data?

That is the normal process, yes.

“3. Writes existing data and write ahead log (WAL) files into InfluxDB 2.1
buckets.”

So, yes, it should keep the data.

Give us some details about how you checked for the data in the new DB, and
maybe some people with more familiarity than I about InfluxDB2 can help out.

Antony.

Sorry, don’t understand that question. (Is it a question? No “?” at the
end.)

Was a statement.

Once updated I started by checking the influx cli. Quickly found that I would need to create a config file for the CLI. Which would need an auth token.

I then started reading the documentation on how to create users and get the auth token which took me to the web interface on the IP address of the influx 2 install. Even though I did specify a default user, password, Organization name, default bucket, it asked me to set this up again in the web interface. Which I used the exact same input I used during the upgrade.

Once that startup wizard was finished on the web interface I went to Data > Buckets to inspect which buckets are on this influx server.

I was expecting to see all my migrated databases as buckets there what I found was:

_monitoring
_tasks
_MyDefaultBucket (the one I created)