How to backup a Solr database? - solr

I wonder how to backup (dump) a Solr database?
If it is only to copy some files, then please specify which files (filename, location etc).
Thanks

We use Solr Replication to do our backup.
You can either have a slave that is dedicated to be a backup or use the "backup" command to make a backup on the master (I never used that last method).

Typically, the index is stored in $SOLR_HOME/data.
Back up that entire folder.

In Solr 8/9 version solr backup and restore is available via its replication handler.
It will create a snapshot of the data which you can also restore later.
Here in the solr documentation page you can find more useful information:
https://solr.apache.org/guide/8_9/making-and-restoring-backups.html#standalone-mode-backups
So this can be used with new 8/9 version if someone is looking for it.

Related

Backup and restore in sonarqube

I would like to backup my SonarQube production server. Can you please help with below two queries:
1\ What all things backup needs to be taken (e.g. database or which all folders from SonarQube home)
2\ Is there any solution already available which can be used directly to take backup of SonarQube.
Thanks and Regards,
Deepti
We regularly do backups in our company, and for that we only backup two things:
the database - because it contains all the data and this is the only thing based on the upgrade notice you need for a restore https://docs.sonarqube.org/latest/setup/upgrading/
the ./extensions/plugin folder - because you never know, what was the version of which plugin afterwards. and you might have a custom plugin, or one which is not in the marketplace, which you will sure forget about
There is no reason to backup the elastic search data, as sonarqube will create all the necessary information on startup. Just be aware, that the first startup will take some time, depending on the amount of data you have stored.
As those two things are actually pretty straight forward, i am not sure if there is really a tool which can help you with that.

How to backup a single database residing in a dbspace in Informix?

I would like to backup a single database residing in a dbspace , while backup utilities in Informix such as onbar or ontape would provide whole system ,logs ,dbspaces backup only .Is there any way to do single database backup in Informix ? if there is then please tell me how to backup and restore a single database ?
If you need backup you could put database in its own dbspace.
Then use "warm restore" only for that dbspace.
If you want to migrate database from instance to instance
you can use dbexport/dbimport or onunload/onload but be careful
and read the manuals first. There are some drawbacks connected with both utilities.
Simply put, Informix does not have a database level backup and restore option. As you mentioned, onbar and ontape allow you to do backups and restore for the entire Informix instance. Having said that, if you are interested in having redundancy for a single database (residing in a dbspace) you can achieve it by turning on mirroring for that dbspace.
you can use the multitenancy feature if you are running an ids12.10 version. There's a special flag -T to restore a database with onbar in a multitenancy environment.

How to properly make SOLR backups

Is there a way, to make SOLR backups daily, without restaring SOLR?
I mean SOLR's feature.
The backup of of your index (which contains the documents) can be started via http-request
http://localhost:8983/solr/yourcore/replication?command=backup
See Making and Restoring Backups of SolrCores
and
Solr 5.2: quick look on Solr backup functionality
for more information.
So if you want a daily backup make a cronjob to call this url regularly.

Backup strategy with master-slave solr 3.6 servers

We're using solr 3.6 replication with 2 servers - a master and a slave - and we're currently looking for the way to do clean backups.
As the wiki says so, we can use a HTTP command to create a snapshot of the master like this: http://myMasterHost/solr/replication?command=backup
But we still have some questions:
What is the benefit of the backup command on a classic shell script copying the index files?
The command only backups the indexes; is it possible to copy also the spellchecker folder? is it needed?
Can we create the snapshot while the application is running, so while there are potential index updates?
When we have to restore the servers from the backup, what do we have to do on the slave?
just copy the snapshot in its index folder, and removing the replication.properties file (or not)?
ask for a fetchindex through the HTTP command http://mySlave/solr/replication?command=fetchindex ?
just empty the slave index folder, in order to force a full replication from the master?
You can use the backup command provided by the ReplicationHandler. It's an asynchronous operation and it takes time if your index is big. This way you don't need to shutdown Solr. Then you'll find within the index directory a new directory named backup.yyyymmddHHMMSS with the backup date. You can also configure how many old backups you want to keep.
After that of course it's better if you move the backup to a safe location, probably to a different server.
I don't think it's possible to backup the spellchecker, not completely sure though.
Of course the command is meant to be run while the application is running. The only problem is that you will probably lose in the backup the documents that you committed after you started the backup itself.
You can also have a look at the lucene CheckIndex tool. Once you backed up the index you could check if the index is ok.
I wouldn't personally use the backups to restore the index on the slaves if you already have a good index on the master. The copy of the index would be automatic using the standard replication process (it's really a copy of the index segments), you don't need to copy them manually unless the backup contains better data than the master.

How to take Hbase table snapshot?

I am new to Hbase and I was looking for Hbase backup and restore solution. CAn you please mention how to take snapshot of Hbase or Hbase table and restoring it as part of recovery solution?
Thanks in advance!!!
Login to hbase shell
snapshot 'table_name','snapshot_name'
you can see whether it create a snapshot or not
from hbase shell, type list_snapshots
There is not currently a way to do this in HBase directly (though there is work going on for this even as we speak: see HBASE-6055. That's targeted for 0.96, meaning late 2012 or early 2013.
In the mean time, if you use another underlying file system besides HDFS, some of them (like the closed-source commercial product, MapR) offer a snapshot feature (for a price).
Creating a snapshot of a table is as simple as running this command from the HBase shell:
hbase(main)> snapshot 'myTable', 'MySnapShot'
Restoring is as simple as issuing these commands from the shell:
hbase(main)> disable 'myTable'
hbase(main)> restore_snapshot 'MySnapShot'
hbase(main)> enable 'myTable'

Resources