{"id":29822995,"url":"https://github.com/timescale/timescaledb-backfill","last_synced_at":"2025-07-29T01:38:18.793Z","repository":{"id":299371653,"uuid":"665081516","full_name":"timescale/timescaledb-backfill","owner":"timescale","description":"Backfill hypertable data from one timescale instance to another","archived":false,"fork":false,"pushed_at":"2025-07-14T14:23:11.000Z","size":427,"stargazers_count":0,"open_issues_count":6,"forks_count":0,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-07-14T18:23:00.812Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/timescale.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","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,"zenodo":null}},"created_at":"2023-07-11T11:50:17.000Z","updated_at":"2024-05-31T15:10:11.000Z","dependencies_parsed_at":"2025-06-16T07:58:00.471Z","dependency_job_id":"86cbeccf-6d0a-4e44-9b9b-eac3da49b076","html_url":"https://github.com/timescale/timescaledb-backfill","commit_stats":null,"previous_names":["timescale/timescaledb-backfill"],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/timescale/timescaledb-backfill","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timescale%2Ftimescaledb-backfill","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timescale%2Ftimescaledb-backfill/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timescale%2Ftimescaledb-backfill/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timescale%2Ftimescaledb-backfill/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timescale","download_url":"https://codeload.github.com/timescale/timescaledb-backfill/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timescale%2Ftimescaledb-backfill/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267616877,"owners_count":24116171,"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","status":"online","status_checked_at":"2025-07-28T02:00:09.689Z","response_time":68,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-07-29T01:38:16.257Z","updated_at":"2025-07-29T01:38:18.786Z","avatar_url":"https://github.com/timescale.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TimescaleDB Backfill\n\nThe TimescaleDB Backfill Tool is a command-line utility designed to support\nthe [dual-write and backfill] low-downtime migration process. It efficiently\ncopies data for a given time range directly from hypertable chunks, without\nthe need for intermediate storage or decompressing compressed chunks. The\ntool operates transactionally, ensuring data integrity during the migration\nprocess.\n\nNote: Because the tool was intended for use in the dual-write and backfill\nmigration, it will delete data already in the target hypertable for the time\nrange that it is copying.\n\n[dual-write and backfill]: https://docs.timescale.com/migrate/latest/dual-write-and-backfill/\n\n## Limitations\n\n- The tool only supports migrating hypertable data. Schema migrations and\n  non-hypertable migrations should be handled separately before using this\n  tool.\n- The tool is optimized for append-only workloads, other scenarios may not\n  be fully supported.\n\n## How to Install\n\n### Install precompiled binary\n\n```sh\nwget https://assets.timescale.com/releases/timescaledb-backfill-x86_64-linux.tar.gz\ntar xf timescaledb-backfill-x86_64-linux.tar.gz\nsudo mv timescaledb-backfill /usr/local/bin/\n```\n\n### Compile\n\nMake sure you have Rust installed on your system.\n\nClone the TimescaleDB Backfill Tool repository from GitHub:\n\n```sh\ngit clone https://github.com/timescale/timescaledb-backfill.git\ncd timescaledb-backfill\n```\n\nBuild and install the tool using Cargo:\n\n```sh\ncargo install --path .\n```\n\n### Amazon Linux 2023\n\n```sh\nsudo su\nyum update -y\nyum groupinstall \"Development Tools\"\nyum install postgresql15\ncurl https://sh.rustup.rs -sSf | sh\necho 'source $HOME/.cargo/env' \u003e\u003e /root/.bashrc\necho 'source $HOME/.cargo/env' \u003e\u003e /home/ec2-user/.bashrc\ngit clone https://github.com/timescale/timescaledb-backfill.git\ncd timescaledb-backfill\ncargo install --path .\n```\n\n## How to Use\n\nThe TimescaleDB Backfill Tool offers three main commands: `stage`, `copy`, and\n`clean`. The workflow involves creating tasks, copying chunks, and cleaning up\nthe administrative schema after the migration.\n\n- **Stage Command:** The `stage` command is used to create copy tasks for\n  hypertable chunks based on the specified completion time (`--until`) and,\n  optionally, a regex filter (`--filter`). If no filter is provided, all\n  hypertables will be backfilled.\n\n  ```sh\n  timescaledb-backfill stage --source $SOURCE_DB --target $TARGET_DB --until '2016-01-02T00:00:00'\n  ```\n\n- **Copy Command:** The `copy` command processes the tasks created during the\n  staging phase and copies the corresponding hypertable chunks to the target\n  TimescaleDB instance.\n\n  ```sh\n  timescaledb-backfill copy --source $SOURCE_DB --target $TARGET_DB\n  ```\n\n- **Clean Command:** The `clean` command removes the administrative schema\n  (`__backfill`) that was used to store the tasks once the migration is completed\n  successfully.\n\n  ```sh\n  timescaledb-backfill clean --target $TARGET_DB\n  ```\n\n### Usage examples\n\n- Backfilling with a filter and until date:\n\n  ```sh\n  timescaledb-backfill stage --source $SOURCE_DB --target $TARGET_DB \\\n    --filter 'my_table.*' --until '2016-01-02T00:00:00'\n  timescaledb-backfill copy --source $SOURCE_DB --target $TARGET_DB\n  timescaledb-backfill clean --target $TARGET_DB\n  ```\n\n- Running multiple stages with different filters and until dates:\n\n  ```sh\n  timescaledb-backfill stage --source $SOURCE_DB --target $TARGET_DB \\\n    --filter 'schema1.table_with_time_as_timestampz' \\\n    --until '2015-01-01T00:00:00'\n  timescaledb-backfill stage --source $SOURCE_DB --target $TARGET_DB \\\n    --filter 'schema1.table_with_time_as_bigint' \\\n    --until '91827364'\n  timescaledb-backfill stage --source $SOURCE_DB --target $TARGET_DB \\\n    --filter 'schema2.*' \\\n    --until '2017-01-01T00:00:00'\n  timescaledb-backfill copy --source $SOURCE_DB --target $TARGET_DB\n  timescaledb-backfill clean --target $TARGET_DB\n  ```\n\n## License\n\nThe TimescaleDB Backfill Tool is open-source software licensed under the Apache\nLicense 2.0. See the LICENSE file for more details.\n\n## Contributing\n\nWe welcome contributions to TimescaleDB Backfill, which is licensed and\nreleased under the open-source Apache License, Version 2. The same\n[Contributor's\nAgreement](https://github.com/timescale/timescaledb/blob/master/CONTRIBUTING.md)\napplies as in TimescaleDB; please sign the [Contributor License\nAgreement](https://cla-assistant.io/timescale/promscale) (CLA) if you're a new\ncontributor.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimescale%2Ftimescaledb-backfill","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimescale%2Ftimescaledb-backfill","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimescale%2Ftimescaledb-backfill/lists"}