{"id":15136760,"url":"https://github.com/react-declarative/appwrite-backup-tool","last_synced_at":"2026-03-05T07:32:07.677Z","repository":{"id":192088296,"uuid":"685953721","full_name":"react-declarative/appwrite-backup-tool","owner":"react-declarative","description":"This backup tool will generate query for each document in AppWrite database and save them as a json files on a hard drive. That means It can handle as much documents as you need. Also there is a script to run AppWrite in Docker on localhost so you can test your backup.","archived":false,"fork":false,"pushed_at":"2024-12-01T18:07:51.000Z","size":130,"stargazers_count":54,"open_issues_count":0,"forks_count":8,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-23T11:40:57.319Z","etag":null,"topics":["appwrite","appwrite-database","async-generator","backup","cicd","es-modules","es6","jenkins","json-per-document","restore","schema","script"],"latest_commit_sha":null,"homepage":"https://github.com/react-declarative/appwrite-backup-tool","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/react-declarative.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"publiccode":null,"codemeta":null}},"created_at":"2023-09-01T11:50:02.000Z","updated_at":"2025-10-23T09:06:15.000Z","dependencies_parsed_at":"2023-09-02T13:43:04.403Z","dependency_job_id":"770cf0c0-e628-41b2-b666-0fb9f7e8da6f","html_url":"https://github.com/react-declarative/appwrite-backup-tool","commit_stats":{"total_commits":75,"total_committers":1,"mean_commits":75.0,"dds":0.0,"last_synced_commit":"b221784ebef3755a27976cdeeba398ccad3d7f17"},"previous_names":["react-declarative/appwrite-backup-tool"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/react-declarative/appwrite-backup-tool","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-declarative%2Fappwrite-backup-tool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-declarative%2Fappwrite-backup-tool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-declarative%2Fappwrite-backup-tool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-declarative%2Fappwrite-backup-tool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/react-declarative","download_url":"https://codeload.github.com/react-declarative/appwrite-backup-tool/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-declarative%2Fappwrite-backup-tool/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30114191,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T03:40:26.266Z","status":"ssl_error","status_checked_at":"2026-03-05T03:39:15.902Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["appwrite","appwrite-database","async-generator","backup","cicd","es-modules","es6","jenkins","json-per-document","restore","schema","script"],"created_at":"2024-09-26T06:41:09.137Z","updated_at":"2026-03-05T07:32:07.638Z","avatar_url":"https://github.com/react-declarative.png","language":"JavaScript","readme":"# 🔥 appwrite-backup-tool\n\n\u003e Minimalistic Appwrite schema dumper with data backup, restore features\n\nThis backup tool will generate query for each document in AppWrite database and save them as a json files on a hard drive. That means It can handle as much documents as you need. Also there is a script to run AppWrite in Docker on localhost so you can test your backup. Build on top of [AsyncGenerator API](https://javascript.info/async-iterators-generators)\n\n\u003ca href=\"https://cloud.appwrite.io/card/64b53d046c81edba0b1a\"\u003e\n\t\u003cimg width=\"350\" src=\"https://cloud.appwrite.io/v1/cards/cloud?userId=64b53d046c81edba0b1a\" alt=\"Appwrite Cloud Card\" /\u003e\n\u003c/a\u003e\n\nGot a question? Feel free to [ask It in issues](https://github.com/react-declarative/appwrite-backup-tool/issues), I need traffic\n\n## Free local Backups for the Cloud and Open Sourced for Self Hosted\n\n\u003e [!NOTE]\n\u003e Free forever. Crontab ready\n\n## Contribute\n\n\u003e [!IMPORTANT]\n\u003e There is another project named [react-declarative](https://github.com/react-declarative/react-declarative) build especially for AppWrite Realtime development. **⭐Star** and **💻Fork** It on github will be appreciated\n\n## Setup\n\n1. Install [Appwrite CLI](https://appwrite.io/docs/command-line) and login\n\n\u003e Windows\n\n```powershell\nnpm install -g appwrite-cli\nSet-ExecutionPolicy RemoteSigned # In PowerShell as Administrator\nappwrite client --endpoint https://cloud.appwrite.io/v1\nappwrite login\n```\n\n\u003e Linux\n\n```bash\nsudo npm config set unsafe-perm true\nsudo npm install -g appwrite-cli\nappwrite client --endpoint https://cloud.appwrite.io/v1\nappwrite login\n```\n\n2. [BACKUP, RESTORE] Write `.env` config in the root (`/appwrite-backup-tool-main/.env`) by using [.env.example](./.env.example)\n\n```env\nAPPWRITE_ENDPOINT=https://cloud.appwrite.io/v1\nAPPWRITE_PROJECT_ID=64b53d0c41fcf5093b12\nAPPWRITE_API_KEY=****\nAPPWRITE_SELF_SIGNED=1\n```\n\n3. [RESTORE] Copy `appwrite.json` to the root (collections schema). See [https://appwrite.io/docs/tooling/command-line/deployment](https://appwrite.io/docs/tooling/command-line/deployment)\n\n## Usage\n\n### Data backup and restore\n\n- Backup all [Databases](https://appwrite.io/docs/databases) and [Buckets](https://appwrite.io/docs/storage)\n\n\u003e Crossplatform\n\n```bash\nnpx -y rimraf backup\nnpm run appwrite:backup\n```\n\n- Deploy all local data to AppWrite server (clear installation is optional but recommended)\n\n\u003e Crossplatform\n\n```bash\nnpm run appwrite:restore\n```\n\n### Schema backup and restore\n\n - Dump currend DB schema\n\n\u003e Windows\n\n```cmd\nnpm run appwrite:fetch:windows\n```\n\n\u003e Linux\n\n```bash\nnpm run appwrite:fetch\n```\n\n - Push new DB schema to AppWrite instance\n\n\u003e Windows\n\n```cmd\nnpm run appwrite:push:windows\n```\n\n\u003e Linux\n\n```bash\nnpm run appwrite:push\n```\n\n### Schema DIFF\n\n - Show changed collection attributes by comparing `appwrite.json` and `appwrite.prev.json`\n\n\u003e Crossplatform\n\n```bash\nnpm run appwrite:diff\n```\n\n - Output\n\n```text\n\n...\n\nCOLLECTION APARTMENT\nADD rent_kom_menedzher_unit\nADD rent_kom_agency_unit\nADD rent_kom_kommisiya_agenstva\nCHANGED rent_kom_czena_sobstvennika_valyuta (array true -\u003e false)\nCHANGED rent_kom_komissiya_agenstva_unit (array true -\u003e false)\n\n...\n\n```\n\n### Other\n\n - Run AppWrite with [Docker Compose](https://docs.docker.com/compose/)\n\n\u003e Windows\n\n```cmd\nnpx -y open-cli http://localhost:8080/\nnpm run appwrite:start:windows\n```\n\n\u003e Linux\n\n```bash\nnpx -y open-cli http://localhost:8080/\nnpm run appwrite:start\n```\n\n - Authorize CLI in Docker AppWrite instance\n\n\u003e Crossplatform\n\n```bash\nappwrite client --selfSigned true --endpoint http://localhost:8080/v1\nappwrite login\n```\n\n - Start AppWrite self-hosted instance (after `.env` changed)\n\n```bash\ndocker-compose up -d --remove-orphans --renew-anon-volumes\n```\n\n - Stop AppWrite self-hosted instance\n\n```bash\ndocker-compose down\n```\n\n - Uninstall AppWrite by removing all volumes and containers (clean install). Also remove networks to avoid mariadb DNS lookup error when downgrade from higher version of AppWrite to lower\n\n```bash\ndocker stop $(docker ps --filter status=running -q)\ndocker rm $(docker ps -aq)\ndocker volume rm $(docker volume ls -q --filter dangling=true)\ndocker rmi $(docker images -a -q)\ndocker network prune --force --filter until=1s\n```\n\n## Moving Appwrite from one machine to another\n\n1. Install [docker-volume-snapshot](https://github.com/junedkhatri31/docker-volume-snapshot)\n\n```bach\nsudo curl -SL https://raw.githubusercontent.com/junedkhatri31/docker-volume-snapshot/main/docker-volume-snapshot -o /usr/local/bin/docker-volume-snapshot\nsudo chmod +x /usr/local/bin/docker-volume-snapshot\n```\n\n2. List volumes and export them\n\n```bash\ndocker volume list\n# appwrite_appwrite-builds\n# appwrite_appwrite-cache\n# appwrite_appwrite-certificates\n# appwrite_appwrite-config\n# appwrite_appwrite-functions\n# appwrite_appwrite-influxdb\n# appwrite_appwrite-mariadb\n# appwrite_appwrite-redis\n# appwrite_appwrite-uploads\n```\n\n3. Export volumes from current machine\n\n```bash\ndocker-volume-snapshot create appwrite_appwrite-builds appwrite_appwrite-builds.tar\ndocker-volume-snapshot create appwrite_appwrite-cache appwrite_appwrite-cache.tar\ndocker-volume-snapshot create appwrite_appwrite-certificates appwrite_appwrite-certificates.tar\ndocker-volume-snapshot create appwrite_appwrite-config appwrite_appwrite-config.tar\ndocker-volume-snapshot create appwrite_appwrite-functions appwrite_appwrite-functions.tar\ndocker-volume-snapshot create appwrite_appwrite-influxdb appwrite_appwrite-influxdb.tar\ndocker-volume-snapshot create appwrite_appwrite-mariadb appwrite_appwrite-mariadb.tar\ndocker-volume-snapshot create appwrite_appwrite-redis appwrite_appwrite-redis.tar\ndocker-volume-snapshot create appwrite_appwrite-uploads appwrite_appwrite-uploads.tar\n```\n\n4. Share volumes from current machine by using web server and [ngrok](https://www.npmjs.com/package/ngrok)\n\n```bash\npython3 -m http.server 9999\n# ngrok http 9999\n```\n\n5. Download volumes on another machine\n\n```bash\nwget http://192.168.1.131:9999/appwrite_appwrite-builds.tar\nwget http://192.168.1.131:9999/appwrite_appwrite-cache.tar\nwget http://192.168.1.131:9999/appwrite_appwrite-certificates.tar\nwget http://192.168.1.131:9999/appwrite_appwrite-config.tar\nwget http://192.168.1.131:9999/appwrite_appwrite-functions.tar\nwget http://192.168.1.131:9999/appwrite_appwrite-influxdb.tar\nwget http://192.168.1.131:9999/appwrite_appwrite-mariadb.tar\nwget http://192.168.1.131:9999/appwrite_appwrite-redis.tar\nwget http://192.168.1.131:9999/appwrite_appwrite-uploads.tar\n```\n\n6. Import volumes data\n\n```bash\ndocker-volume-snapshot restore appwrite_appwrite-builds.tar appwrite_appwrite-builds\ndocker-volume-snapshot restore appwrite_appwrite-cache.tar appwrite_appwrite-cache\ndocker-volume-snapshot restore appwrite_appwrite-certificates.tar appwrite_appwrite-certificates\ndocker-volume-snapshot restore appwrite_appwrite-config.tar appwrite_appwrite-config\ndocker-volume-snapshot restore appwrite_appwrite-functions.tar appwrite_appwrite-functions\ndocker-volume-snapshot restore appwrite_appwrite-influxdb.tar appwrite_appwrite-influxdb\ndocker-volume-snapshot restore appwrite_appwrite-mariadb.tar appwrite_appwrite-mariadb\ndocker-volume-snapshot restore appwrite_appwrite-redis.tar appwrite_appwrite-redis\ndocker-volume-snapshot restore appwrite_appwrite-uploads.tar appwrite_appwrite-uploads\n```\n\n7. Start appwrite\n\n```bash\ndocker-compose up -d --remove-orphans --renew-anon-volumes\n```\n\n8. [Optional] Follow the appwrite [upgrade guide](https://appwrite.io/docs/advanced/self-hosting/update)\n\n\u003e When migrating, on clean machine restore volumes first, then run `docker-compose up`, the appwrite should not be started the first time. If It was, there is a cleanup script which remove everything from the docker on machine. When updating command should be executed while previous appwrite installation still running, dont stop it!\n\n```bash\n# parent_directory \u003c= you run the command in this directory\n# └── appwrite\n#     └── docker-compose.yml\n\ndocker run -it --rm \\\n    --volume /var/run/docker.sock:/var/run/docker.sock \\\n    --volume \"$(pwd)\"/appwrite:/usr/src/code/appwrite:rw \\\n    --entrypoint=\"upgrade\" \\\n    appwrite/appwrite:1.5.4\n\n# appwrite \u003c= navigate to the appwrite directory\n# └── docker-compose.yml\n\ncd appwrite/\ndocker compose exec appwrite migrate\n```\n\n## See also\n\nLooks like AppWrite file endpoint is limited `to 60 requests in every 1 minutes per IP address`. So [I added a delay](./scripts/restore.mjs), you can change it If you need to\n\n\u003e Quite usefull when `AppwriteException [Error]: The document data is missing. Try again with document data populated`...\n\n```javascript\nconst DOCUMENT_WRITE_DELAY = 1500;\nconst FILE_UPLOAD_DELAY = 2_000;\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freact-declarative%2Fappwrite-backup-tool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freact-declarative%2Fappwrite-backup-tool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freact-declarative%2Fappwrite-backup-tool/lists"}