{"id":5553,"date":"2017-10-30T12:52:24","date_gmt":"2017-10-30T12:52:24","guid":{"rendered":"http:\/\/www.garysieling.com\/blog\/?p=5553"},"modified":"2017-10-30T12:52:24","modified_gmt":"2017-10-30T12:52:24","slug":"back-restore-solr-using-csv-export-import","status":"publish","type":"post","link":"https:\/\/www.garysieling.com\/blog\/back-restore-solr-using-csv-export-import\/","title":{"rendered":"Back up and restore Solr using CSV export and import"},"content":{"rendered":"<p>This is really easy to do, if you first SSH into the destination machine (assuming the Solr configs exist):<\/p>\n<pre>\ncurl -o books.csv \"http:\/\/<original server>:8983\/solr\/books\/select?q=*%3A*&wt=csv&rows=10000000\"\n\ncurl \"http:\/\/localhost:8983\/solr\/admin\/cores?action=CREATE&name=books\"\n\n curl \"http:\/\/localhost:8983\/solr\/books\/update?stream.file=\/home\/gary\/books.csv&stream.contentType=text\/csv\n;charset=utf-8&skip=_version_&commit=true\"\n<\/pre>\n<p>Important notes:<\/p>\n<ul>\n<li>If you are upgrading and copied the Solr configs, you need to delete the data directory or the core won&#8217;t load (due to Lucene being out of date)<\/li>\n<li>If you export\/import this way, you get _version_ included, which is an internal field &#8211; that&#8217;s why it gets skipped on the second step<\/li>\n<li>This will obviously only work if you have the field data stored in the source solr<\/li>\n<\/ul \n\n","protected":false},"excerpt":{"rendered":"<p>Reloading Solr from a CSV<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[4],"tags":[77,130,348,517],"aioseo_notices":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/5553"}],"collection":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/comments?post=5553"}],"version-history":[{"count":0,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/5553\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/media?parent=5553"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/categories?post=5553"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/tags?post=5553"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}