Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

Backup The Hive 4 Cassandra database and transfer to new The Hive 4 server #229

Open
trinksie opened this issue Mar 25, 2021 · 4 comments
Open
Assignees
Labels
question THeHive4 Related to TheHive4 doc.

Comments

@trinksie
Copy link

trinksie commented Mar 25, 2021

Hello! I have been reading through the current Backup/Restore procedure [1] which clearly states that this "[...] has only been tested on single node Cassandra server". What, however, if you want/need to backup the Cassandra database (i.e. create a snapshot) of an existing The Hive 4 server, transfer it to a newly deployed (vanilla) The Hive 4 server and restore it there? Or picture the scenario that you have created backups (snapshots) on your existing The Hive 4 server and that server (bare metal/vm) crashes and needs to be re-deployed from scratch?

I have tested the current Backup/Restore procedure [1] as per backing up on existing The Hive 4 server and attempting to restore on newly deployed The Hive 4 server (identical setup/configuration as existing/working The Hive 4 server to import from) and as expected it fails, with all sorts of schema issues and scalligraph errors when trying to start The Hive 4 on the newly deployed The Hive 4 server.

Do you have a suggested and verified approach how to export/snapshot a The Hive 4 Cassandra database on an existing/working server and transfer/restore it on a newly deployed The Hive 4 server? Any suggestions welcome...

Thank you.

[1] https://github.com/TheHive-Project/TheHiveDocs/blob/master/TheHive4/Administration/Backup_Restore.md

@samsplunks
Copy link

Having the same exact issue.

@jeromeleonard jeromeleonard self-assigned this Feb 10, 2022
@jeromeleonard jeromeleonard added question THeHive4 Related to TheHive4 doc. labels Feb 10, 2022
@jeromeleonard
Copy link
Contributor

We have improved the procedure, did you try it ? http://docs.thehive-project.org/thehive/operations/backup-restore/

@JohnEskimSmith
Copy link

backup db not worked. i am trying to repeat https://docs.thehive-project.org/thehive/operations/backup-restore/. Moreover, without the contents of the vol/thehive/index/global directory the TheHive initializes a new schema for the database, does not see what was.
Also, тoday, i am trying:

  1. get all /data - from Cassandra
  2. deploy new instance TheHive, but use as index - elasticsearch.
    Not worked. Thus, any attempt to restore a new instance based on existing data from cassandra without indexes(Lucene, Elasticsearch) does not work.

@ivityc
Copy link

ivityc commented Mar 10, 2022

We have improved the procedure, did you try it ? http://docs.thehive-project.org/thehive/operations/backup-restore/

I have the same use case mentioned at the beginning of this post.
Furthermore the procedure mentioned in the link above seems to be wrong anyway.
When you go to the ''restore'' part it says to extract the archive
tar jxf /PATH/TO/backup.tbz -C /tmp/cassandra_backup
the destination folder is cassandr_backup
but the next commands just refer to a folder named cassandra, so it will fail.
this for I in ls /tmp/cassandra/var/lib/**cassandra**/data/<KEYSPACE> ; do [...snip...]
should be ls /tmp/cassandra/var/lib/**cassandra_backup**/data/<KEYSPACE>
same for the remaining part of the procedure and the example script provided where for istance this line seems to be wrong

Restore keyspace

cqlsh -u cassandra -p ${CASSANDRA_PASSWORD} cassandra --file schema_${SNAPSHOT}_${SNAPSHOT_INDEX}.cql

as it contain an extra ''cassandra'' text, after the password variable.

So is there any way to create a snapshot from a live server and restore it to a different one (to keep dB cases aligned in case primary server fail) ?
Thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question THeHive4 Related to TheHive4 doc.
Projects
None yet
Development

No branches or pull requests

5 participants