This is archived documentation for InfluxData product versions that are no longer maintained. For newer documentation, see the latest InfluxData documentation.
This page guides you through upgrading from InfluxDB 0.11 to 0.12.
Note: You can follow the same steps to upgrade from 0.10 to 0.12 (just replace all the 0.11 mentions with 0.10), but be sure to convert any remaining
b1
andbz1
shards toTSM
format before you start. InfluxDB 0.12 cannot read non-TSM
shards.In your data directory:
- Non-
TSM
shards are files of the form:data/<database>/<retention_policy>/<shard_id>
TSM
shards are files of the form:data/<database>/<retention_policy>/<shard_id>/<file>.tsm
In the next sections you will:
- Transfer your metastore
information to the new 0.12 store.
In versions prior to 0.12, InfluxDB stores metastore
information in
raft.db
via the raft services. In 0.12, InfluxDB stores metastore information inmeta.db
, a binary protobuf file. - Generate a new configuration file.
To start out, you must be working with version 0.10 or 0.11 (don’t upgrade the
influxd
binary yet!).
If you’ve already upgraded the binary, reinstall 0.10 or 0.11 (see the end of the page for links); InfluxDB 0.12
will yield an error
(run: create server: detected /var/lib/influxdb/meta/raft.db. [...]
) if you
attempt to start the process without completing the steps below.
The examples below assume you are working with a version of linux.
Before you start, we recommend making a copy of the entire 0.11
meta
directory in case you experience problems with the upgrade. The upgrade process removes theraft.db
andnode.json
files from themeta
directory:cp -r <path_to_meta_directory> <path_to_011_meta_directory_backup>
Example:
Create a copy of the 0.11
meta
directory inbackups/
:~# cp -r /var/lib/influxdb/meta backups/
1. While still running 0.11, export the metastore data to a different directory:
influxd backup <path_to_metastore_backup>
The directory will be created if it doesn’t already exist.
Example:
Export the 0.11 metastore to /tmp/backup
:
~# influxd backup /tmp/backup/
2016/04/01 15:33:35 backing up metastore to /tmp/backup/meta.00
2016/04/01 15:33:35 backup complete
2. Stop the influxdb
service:
sudo service influxdb stop
3. Upgrade the influxd
binary from 0.11 to 0.12. but do not start the service.
4. Upgrade your metastore to the 0.12 store by performing a restore
with
the backup you created in step 1.
influxd restore -metadir=<path_to_012_meta_directory> <path_to_metastore_backup>
Example:
Restore /tmp/backup
to the meta directory in /var/lib/influxdb/meta
:
~# influxd restore -metadir=/var/lib/influxdb/meta /tmp/backup
Using metastore snapshot: /tmp/backup/meta.00
Note: If you run
influxd restore
as the root user, you will need to change the permissions on themeta.db
file:sudo chown influxdb:influxdb /var/lib/influxdb/meta/*
5. Generate a new configuration file.
InfluxDB 0.12 has several new settings in the configuration file.
The influxd config
command prints out a new TOML-formatted configuration with all the available configuration options set to their default values.
On POSIX systems, a new configuration file can be generated by redirecting the output of the command to a file.
influxd config > /etc/influxdb/influxdb_012.conf.generated
Compare your old configuration file against the newly generated InfluxDB 0.12 file and manually update any defaults with your localized settings.
Note: If you’re working on a system other than macOS you will need to change the following directories in your newly-generated configuration file:
- Change the
dir
setting in the[meta]
section to/var/lib/influxdb/meta
- Change the
dir
setting in the[data]
section to/var/lib/influxdb/data
- Change the
wal-dir
setting in the[data]
section to/var/lib/influxdb/wal
6. Start the 0.12 service:
sudo service influxdb start
7. Confirm that your metastore data is present.
The 0.12 output from the queries SHOW DATABASES
,SHOW USERS
and
SHOW RETENTION POLICIES ON <database_name>
should match the 0.11 output.
If your metastore data do not appear to be present, stop the service, reinstall
InfluxDB 0.11, restore the copy you made of the entire 0.11 meta
directory to
the meta
directory, and try working through these steps again.
8. Explore the new 0.12 features.
See Differences between InfluxDB 0.12 and 0.11.
URLs for InfluxDB 0.11:
Ubuntu & Debian (64-bit)
wget https://dl.influxdata.com/influxdb/releases/influxdb_0.11.1-1_amd64.deb
sudo dpkg -i influxdb_0.11.1-1_amd64.deb
Ubuntu & Debian (ARM)
wget https://dl.influxdata.com/influxdb/releases/influxdb_0.11.1-1_armhf.deb
sudo dpkg -i influxdb_0.11.1-1_armhf.deb
RedHat & CentOS (64-bit)
wget https://dl.influxdata.com/influxdb/releases/influxdb-0.11.1-1.x86_64.rpm
sudo yum localinstall influxdb-0.11.1-1.x86_64.rpm
RedHat & CentOS (ARM)
wget https://dl.influxdata.com/influxdb/releases/influxdb-0.11.1-1.armhf.rpm
sudo yum localinstall influxdb-0.11.1-1.armhf.rpm
Standalone binary (64-bit)
wget https://dl.influxdata.com/influxdb/releases/influxdb-0.11.1-1_linux_amd64.tar.gz
tar xvfz influxdb-0.11.1-1_linux_amd64.tar.gz
Standalone binary (ARM)
wget https://dl.influxdata.com/influxdb/releases/influxdb-0.11.1-1_linux_armhf.tar.gz
tar xvfz influxdb-0.11.1-1_linux_armhf.tar.gz
For other versions, please scan the https://dl.influxdata.com/ manifest for the appropriate InfluxDB 0.11.1 package.
Homebrew users
It is simpler to grab a tarball of Darwin binaries than to downgrade a Homebrew installation. Since the influxd
binary is only briefly needed for the metastore export, the unpacked tarball can be deleted without harm once the metastore backup has been successfully restored via InfluxDB 0.12.
wget https://dl.influxdata.com/influxdb/releases/influxdb-0.11.1-1_darwin_amd64.tar.gz
tar -xvf influxdb-0.11.1-1_darwin_amd64.tar.gz
./influxdb-0.11.1-1/usr/bin/influxd