Installation

Upgrade Splunk on Linux

nikhilagrawal
Path Finder

Hi

We are running Splunk 5.0.3, build 162460 on our UAT environment. I tried upgrading to latest version 6. I am following the steps described in the document.
1. Stop current Splunk instance.
2. Copy splunk-6.0-182037-Linux-x86_64.gz same directory (opt/splunk/).
3. run: tar xvfz splunk-6.0-182037-Linux-x86_64.gz under (opt/splunk/). Which created another directory "Splunk". so now there is /opt/Splunk/Splunk.
4. Then tried (mv * ../ )under opt/splunk/splunk to move all dir from new splunk instance to upper level. I thought this will overwrite the existing splunk files. But its returning error "Can't overwrite etc, Bin and some other directories.
Can someone please suggest what is wrong here?

Thanks
Nik

Tags (1)
0 Karma
1 Solution

bbingham
Builder

if you're going to try extracting from the already existing directory (/opt/splunk) you'll actually want to use this command:

tar -xzvf splunk-6.0-182037-Linux-x86_64.gz  --strip-components=1

This will tell the tar command to strip off the "splunk" dir during extraction and only extract the contents.

View solution in original post

bbingham
Builder

if you're going to try extracting from the already existing directory (/opt/splunk) you'll actually want to use this command:

tar -xzvf splunk-6.0-182037-Linux-x86_64.gz  --strip-components=1

This will tell the tar command to strip off the "splunk" dir during extraction and only extract the contents.

nikhilagrawal
Path Finder

slight change:
tar -xzvf splunk-6.0-182037-Linux-x86_64.gz --strip-path=1
it worked with the change.
Thanks

0 Karma

jamesarmitage
Path Finder

The --strip-components flag is appropriate for CentOS / RHEL tar. Check the manpage for your distro to determine the proper syntax.

bbingham, thank you. This tip saved me a fair bit of frustration upgrading two instances installed on the same server.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

What Is Splunk? Here’s What You Can Do with Splunk

Hey Splunk Community, we know you know Splunk. You likely leverage its unparalleled ability to ingest, index, ...

Level Up Your .conf25: Splunk Arcade Comes to Boston

With .conf25 right around the corner in Boston, there’s a lot to look forward to — inspiring keynotes, ...

Manual Instrumentation with Splunk Observability Cloud: How to Instrument Frontend ...

Although it might seem daunting, as we’ve seen in this series, manual instrumentation can be straightforward ...