Downgrade to v0.11 in order to properly upgrade without losing data. #6373

Closedclaytondukes opened this issue on 13 Apr 2016 · 7 comments

Comments

One of our servers was patched with kernel updates today, now influx won’t start.
run: create server: detected /var/lib/influxdb/meta/raft.db. To proceed, you'll need to either 1) downgrade to v0.11.x, export your metadata, upgrade to the current version again, and then import the metadata or 2) delete the file, which will effectively reset your database. For more assistance with the upgrade, see: https://docs.influxdata.com/influxdb/v0.12/administration/upgrading/ 
I can’t find any instructions on how to downgrade.
Why not keep the previous versions in your repo if you aren’t going to auto-upgrade between versions?
The real problem here is: please don’t kill people’s systems, just upgrade it for them.
In case anyone has the same trouble I did:
wget https://s3.amazonaws.com/influxdb/influxdb_0.11.1-1_amd64.deb
dpkg -i ./influxdb_0.11.1-1_amd64.deb

Author

claytondukes commented on 13 Apr 2016 •edited

For the sake of completeness. The process was ridiculously simple once I figured it out. The documentation doesn’t show much or explain it very well.
wget https://s3.amazonaws.com/influxdb/influxdb_0.11.1-1_amd64.deb
dpkg -i ./influxdb_0.11.1-1_amd64.deb
Next, start influx v0.11
service influxdb start
Check the log to be sure it is running:
tail /var/log/influxdb/influxd.log
Now back up the metadata – all you need is the meta, not the actual database:
influxd backup /tmp/influx_meta_backup
Stop influx
service influxdb stop
Next, install v0.12:
wget https://s3.amazonaws.com/influxdb/influxdb_0.12.1-1_amd64.deb
And install:
dpkg -i ./influxdb_0.12.1-1_amd64.deb
Then restore the metadata:
influxd restore -metadir /var/lib/influxdb/meta /tmp/influx_meta_backup
Start influx:
service influxdb start
Why wouldn’t the upgrade script just do this automatically?
Thank you, I hope that the maintainer includes those steps in the upgrade script in the future.

Contributor

toddboom commented on 16 Apr 2016

@claytondukes thanks for writing this up. i’ll leave this open for the moment, but will update the docs to clarify all the steps you outlined and close it out once that’s done.

Author

claytondukes commented on 9 May 2016

@toddboom, I had to update another system today and noticed I left out a step service influxdb stop after backing up from the old version.

Contributor

mvadu commented on 27 May 2016

Thank you @claytondukes for the instructions. However I am stuck with back up because I have created Influx 0.11 setup with a custom config which used a non default path for the DB storage. Now only way to provide that info to Influxd process is via -config option, but backup command along with -config is not working.

Contributor

mvadu commented on 28 May 2016

Never mind, I have to run two instances, one with influx.exe -conf <config name>, in a separate terminal run influx.exe backup <path>, it worked.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to commentMeasureMeasure