{"id":18686150,"url":"https://github.com/xenit-eu/solr-backup","last_synced_at":"2025-11-07T23:30:33.045Z","repository":{"id":46726071,"uuid":"390699992","full_name":"xenit-eu/solr-backup","owner":"xenit-eu","description":"Repository which creates an artifact allowing to backup solr on S3 / Caringo Swarm","archived":false,"fork":false,"pushed_at":"2024-04-15T08:44:18.000Z","size":161,"stargazers_count":0,"open_issues_count":11,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-16T13:05:15.152Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xenit-eu.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2021-07-29T11:23:34.000Z","updated_at":"2024-04-17T22:41:41.024Z","dependencies_parsed_at":"2022-08-22T08:50:54.339Z","dependency_job_id":"bc7ba7b0-7f9c-44bc-9370-16c1b54fe0ef","html_url":"https://github.com/xenit-eu/solr-backup","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xenit-eu%2Fsolr-backup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xenit-eu%2Fsolr-backup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xenit-eu%2Fsolr-backup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xenit-eu%2Fsolr-backup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xenit-eu","download_url":"https://codeload.github.com/xenit-eu/solr-backup/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239541851,"owners_count":19656102,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T10:26:23.444Z","updated_at":"2025-11-07T23:30:33.007Z","avatar_url":"https://github.com/xenit-eu.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Solr backup\n\nThis module builds an artifact which can be used to backup and restore solr indexes into S3 and (some of the)\nS3-compatible storage endpoints.\n\nThe original code for the S3 backup was taken\nfrom: https://github.com/athrog/solr/tree/solr-15089/solr/contrib/s3-repository.  \nIt has been packported to solr6, since this is the version used by Alfresco currently. It cannot be backported further\nto solr4, because the only backup repository-storage supported back then was the filesystem.  \nBackported version is available in src/main/java/org/apache/solr/s3.\n\nSince that version does not work fully even with Amazon S3, an adapted version has been implemented in\nsrc/main/java/eu/xenit/solr/backup/s3.\n\nThis new version has been tested against S3-compatible backends:\n\n* localstack s3\n\nIntegration tests follow the same line:\n\n* wait for solr to be populated with data, tracking alfresco\n* trigger a backup /solr/alfresco/replication?command=backup\u0026repository=s3\u0026location=s3:///\u0026numberToKeep=3\n* check if the backup finished in a certain timeout (3 minutes) by following the output of\n  /solr/alfresco/replication?command=details\n* trigger a restore /solr/alfresco/replication?command=restore\u0026repository=s3\u0026location=s3:///\n* check if the restore was successful in a certain timeout (3 minutes) by following the output of\n  /solr/alfresco/replication?command=restorestatus\n## Setup\n\nyou need to put the solr.xml file under /opt/alfresco-search-services/solrhome/\n```\n\u003c?xml version='1.0' encoding='UTF-8'?\u003e\n\u003csolr\u003e\n    \u003cstr name=\"adminHandler\"\u003e${adminHandler:org.alfresco.solr.AlfrescoCoreAdminHandler}\u003c/str\u003e\n    \u003cbackup\u003e\n        \u003crepository name=\"s3\" class=\"eu.xenit.solr.backup.s3.S3BackupRepository\" default=\"false\"\u003e\n            \u003cstr name=\"s3.bucket.name\"\u003e${S3_BUCKET_NAME:}\u003c/str\u003e\n            \u003cstr name=\"s3.endpoint\"\u003e${S3_ENDPOINT:http://s3.eu-central-1.amazonaws.com}\u003c/str\u003e\n            \u003cstr name=\"s3.region\"\u003e${S3_REGION:eu-central-1}\u003c/str\u003e\n            \u003cstr name=\"s3.access.key\"\u003e${S3_ACCESS_KEY:}\u003c/str\u003e\n            \u003cstr name=\"s3.secret.key\"\u003e${S3_SECRET_KEY:}\u003c/str\u003e\n            \u003cstr name=\"s3.proxy.host\"\u003e${S3_PROXY_HOST:}\u003c/str\u003e\n            \u003cint name=\"s3.proxy.port\"\u003e${S3_PROXY_PORT:0}\u003c/int\u003e\n            \u003cbool name=\"s3.path.style.access.enabled\"\u003e${S3_PATH_STYLE_ACCESS_ENABLED:false}\u003c/bool\u003e\n        \u003c/repository\u003e\n    \u003c/backup\u003e\n\u003c/solr\u003e\n```\n\nand specify the Environment or Java variables \n\n## Variables\n\nall of these variable can be set as environment variable or as a system property so that it is substituted in solr.xml\n\n| Environment variable         | Java system property           | Default                              | required |\n|------------------------------|--------------------------------|--------------------------------------|----------|\n| S3_ENDPOINT                  | -DS3_ENDPOINT                  | http://s3.eu-central-1.amazonaws.com | false    |\n| S3_BUCKET_NAME               | -DS3_BUCKET_NAME               |                                      | true     |\n| S3_REGION                    | -DS3_REGION                    | eu-central-1                         | false    |\n| S3_ACCESS_KEY                | -DS3_ACCESS_KEY                |                                      | false    |\n| S3_SECRET_KEY                | -DS3_SECRET_KEY                |                                      | false    |\n| S3_PROXY_HOST                | -DS3_PROXY_HOST                |                                      | false    |\n| S3_PROXY_PORT                | -DS3_PROXY_PORT                |                                      | false    |\n| S3_PATH_STYLE_ACCESS_ENABLED | -DS3_PATH_STYLE_ACCESS_ENABLED | false                                | false    |\n\n## Testing against DataCore Swarm docker\n\n    ./gradlew integration-tests:solr6:integrationTestSwarmDocker\n\nSolr waits for the Swarm environment to be started and then requests an ACCESS_KEY via an init script, which is further\nused to authenticate.\n\n## Testing LocalStack S3 or any other s3  bucket\n\nBefore running the tests, following variables need to be set to an S3 bucket and working credentials.\n\n    export S3_ENDPOINT=...\n    export S3_REGION=...\n    export S3_BUCKET_NAME=...\n    export S3_ACCESS_KEY=...\n    export S3_SECRET_KEY=...\n    \n    ./gradlew integration-tests:solr6:integrationTest\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxenit-eu%2Fsolr-backup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxenit-eu%2Fsolr-backup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxenit-eu%2Fsolr-backup/lists"}