Knowledge Management

Is there any other way to do a backup of KV store data than using the "splunk backup kvstore" command?

svendby90
Path Finder

We have an instance where KV store is not running and we're looking to clean the whole thing out. However, we would like to see if we're able to keep the data.

So, my question is; is there any other way to do a backup of KV store data than using the "splunk backup kvstore" command?

Labels (1)
0 Karma
1 Solution

tshah-splunk
Splunk Employee
Splunk Employee

Hey @svendby90,

There is an alternate way as well to take a backup of the kvstore other than the backup command. Steps are as below:

  • Stop splunk

 

$SPLUNK_HOME/bin/splunk stop​

 

  • Create tar of the kvstore directory

 

tar -cvzf <destination_path>/backup.tgz $SPLUNK_HOME/var/lib/splunk/kvstore​

 

  • Start splunk again

 

$SPLUNK_HOME/bin/splunk start​

 

---
If you find the answer helpful, an upvote/karma is appreciated

View solution in original post

isoutamo
SplunkTrust
SplunkTrust

Hi

here is one old discussion how you could do it online without service break https://community.splunk.com/t5/Splunk-Enterprise/Are-there-any-automated-scripts-to-back-up-the-kvs...

r. Ismo

0 Karma

tshah-splunk
Splunk Employee
Splunk Employee

Hey @svendby90,

There is an alternate way as well to take a backup of the kvstore other than the backup command. Steps are as below:

  • Stop splunk

 

$SPLUNK_HOME/bin/splunk stop​

 

  • Create tar of the kvstore directory

 

tar -cvzf <destination_path>/backup.tgz $SPLUNK_HOME/var/lib/splunk/kvstore​

 

  • Start splunk again

 

$SPLUNK_HOME/bin/splunk start​

 

---
If you find the answer helpful, an upvote/karma is appreciated

haraksin
Path Finder

How do you restore from this method? If I clean the KVstore after backing up like this, won't untarring over the cleaned files just put the system back in the state it was, uncleaned? Or even worse, would it break mongo?

0 Karma
Get Updates on the Splunk Community!

Index This | I’m short for "configuration file.” What am I?

May 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with a Special ...

New Articles from Academic Learning Partners, Help Expand Lantern’s Use Case Library, ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Your Guide to SPL2 at .conf24!

So, you’re headed to .conf24? You’re in for a good time. Las Vegas weather is just *chef’s kiss* beautiful in ...