{"id":20141261,"url":"https://github.com/alekcz/magma","last_synced_at":"2026-05-10T08:41:55.994Z","repository":{"id":57713084,"uuid":"237046334","full_name":"alekcz/magma","owner":"alekcz","description":"A Clojure library to back up your Firestore to Google Storage","archived":false,"fork":false,"pushed_at":"2020-02-28T12:31:59.000Z","size":31,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-05-28T12:39:27.853Z","etag":null,"topics":["backup","firebase","firestore"],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alekcz.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}},"created_at":"2020-01-29T17:49:07.000Z","updated_at":"2022-02-03T15:24:35.000Z","dependencies_parsed_at":"2022-09-05T22:50:40.910Z","dependency_job_id":null,"html_url":"https://github.com/alekcz/magma","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alekcz%2Fmagma","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alekcz%2Fmagma/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alekcz%2Fmagma/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alekcz%2Fmagma/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alekcz","download_url":"https://codeload.github.com/alekcz/magma/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241578036,"owners_count":19985094,"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":["backup","firebase","firestore"],"created_at":"2024-11-13T21:56:52.373Z","updated_at":"2026-05-10T08:41:55.949Z","avatar_url":"https://github.com/alekcz.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# magma\n\nA Clojure library to back up your Firestore to Google Storage\n\n![Clojure CI](https://github.com/alekcz/magma/workflows/Clojure%20CI/badge.svg) [![codecov](https://codecov.io/gh/alekcz/magma/branch/master/graph/badge.svg)](https://codecov.io/gh/alekcz/magma)  \n\n[![Clojars Project](https://img.shields.io/clojars/v/alekcz/magma.svg)](https://clojars.org/alekcz/magma)\n\n\n## Usage\n\nEnvironment variables:\n1. GOOGLE_CLOUD_PROJECT contains the name of the project containing both firestore and the cloud storage\n2. GOOGLE_APPLICATION_CREDENTIALS contains the `.json` credential for the service account being used. \n\n`magma` uses [alekcz/google-credentials](https://github.com/alekcz/google-credentials) to load Google Credentials from the `GOOGLE_APPLICATION_CREDENTIALS`\n\n```clojure \n\n[alekcz/magma \"1.0.0\"]\n\n(require '[magma.core :as magma])\n\n\n(magma/create-backup-bucket)\n;by default the root is called magma-\u003cproject-id\u003e. \n;The bucket is called named after the root\n\n(magma/list-firestore-backups)\n\n(magma/last-firestore-backup)\n\n(magma/backup-firestore)\n(magma/backup-firestore \"gs://bucket-name\")\n\n(magma/restore-firestore \"gs://bucket-name/yyyy-MM-ddTHH:mm:ss.SSS\")\n\n(magma/roll-back-firestore) ;for your safety magma waits 60 seconds before starting the roll back\n\n(magma/deleting-your-backups-is-a-really-bad-idea \"yyyy-MM-ddTHH:mm:ss_SSS\")\n\n;Renaming the root\n(magma/rename-root \"namespace\")\n; The root is now magma-namespace-\u003cproject-id\u003e\n; This function primarily exists to enable testing\n```\n\nI'm currently using `magma` to backup my DB just before I deploy a change to my production API.\n\n## License\n\nCopyright © 2020 Alexander Oloo\n\nThis program and the accompanying materials are made available under the\nterms of the Eclipse Public License 2.0 which is available at\nhttp://www.eclipse.org/legal/epl-2.0.\n\nThis Source Code may also be made available under the following Secondary\nLicenses when the conditions for such availability set forth in the Eclipse\nPublic License, v. 2.0 are satisfied: GNU General Public License as published by\nthe Free Software Foundation, either version 2 of the License, or (at your\noption) any later version, with the GNU Classpath Exception which is available\nat https://www.gnu.org/software/classpath/license.html.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falekcz%2Fmagma","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falekcz%2Fmagma","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falekcz%2Fmagma/lists"}