{"id":15767120,"url":"https://github.com/robertslando/node-influxdb-backup","last_synced_at":"2026-02-21T03:33:13.359Z","repository":{"id":57273738,"uuid":"173302365","full_name":"robertsLando/node-influxdb-backup","owner":"robertsLando","description":"Node influxdb backup/restore module.","archived":false,"fork":false,"pushed_at":"2022-12-09T14:38:07.000Z","size":1250,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-19T03:54:38.130Z","etag":null,"topics":["backup","backup-database","influx","influxd","influxdb","node","node-influx","restore","restore-database"],"latest_commit_sha":null,"homepage":" https://robertslando.github.io/node-influxdb-backup/","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/robertsLando.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"robertsLando","patreon":"user?u=16906849","custom":"paypal.me/daniellando"}},"created_at":"2019-03-01T12:59:41.000Z","updated_at":"2023-03-09T02:52:44.000Z","dependencies_parsed_at":"2023-01-25T22:15:27.357Z","dependency_job_id":null,"html_url":"https://github.com/robertsLando/node-influxdb-backup","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/robertsLando/node-influxdb-backup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertsLando%2Fnode-influxdb-backup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertsLando%2Fnode-influxdb-backup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertsLando%2Fnode-influxdb-backup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertsLando%2Fnode-influxdb-backup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robertsLando","download_url":"https://codeload.github.com/robertsLando/node-influxdb-backup/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertsLando%2Fnode-influxdb-backup/sbom","scorecard":{"id":780460,"data":{"date":"2025-08-11","repo":{"name":"github.com/robertsLando/node-influxdb-backup","commit":"abf131637b9a7b8ca913e5e54928cc5f6f621f9b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/25 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"24 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7","Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x","Warn: Project is vulnerable to: GHSA-wm7h-9275-46v2","Warn: Project is vulnerable to: GHSA-rv95-896h-c2vc","Warn: Project is vulnerable to: GHSA-qw6h-vgh9-j6wx","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-44fp-w29j-9vj5","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-rhx6-c78j-4q9w","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg","Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p","Warn: Project is vulnerable to: GHSA-fwr7-v2mv-hh25","Warn: Project is vulnerable to: GHSA-pp7h-53gx-mx7r","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-qgfr-5hqp-vrw9","Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T04:47:06.824Z","repository_id":57273738,"created_at":"2025-08-23T04:47:06.824Z","updated_at":"2025-08-23T04:47:06.824Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280424212,"owners_count":26328462,"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-10-22T02:00:06.515Z","response_time":63,"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":["backup","backup-database","influx","influxd","influxdb","node","node-influx","restore","restore-database"],"created_at":"2024-10-04T13:20:39.401Z","updated_at":"2025-10-22T10:49:02.244Z","avatar_url":"https://github.com/robertsLando.png","language":"JavaScript","funding_links":["https://github.com/sponsors/robertsLando","https://patreon.com/user?u=16906849","paypal.me/daniellando","https://www.patreon.com/join/2409916"],"categories":[],"sub_categories":[],"readme":"# influx-backup\n\n[![NPM version](http://img.shields.io/npm/v/influx-backup.svg)](https://www.npmjs.com/package/influx-backup)\n[![Downloads](https://img.shields.io/npm/dm/influx-backup.svg)](https://www.npmjs.com/package/influx-backup)\n\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)\n[![MIT Licence](https://badges.frapsoft.com/os/mit/mit.png?v=103)](https://opensource.org/licenses/mit-license.php)\n\n[![NPM](https://nodei.co/npm/influx-backup.png?downloads=true)](https://nodei.co/npm/influx-backup/)\n\n## Description 📔\n\nNodeJS module for InfluxDB backup/restore.\n\nThis module uses the `influxd` command to backup and restore the backup, the backup consists in a zip file with all the data generated by the `influxd` command.\n\nUses InfluxDB *portable backups* introduced in InfluxDb v1.5, check [docs](https://docs.influxdata.com/influxdb/v1.7/administration/backup_and_restore/#online-backup-and-restore-for-influxdb-oss) for more info.\n\n## Requirements ❗\n\n- `influxd` bin must be installed in your system. Check it by running `which influxd` command\n- **InfluxDB version \u003e v1.5**\n\n\n## Install 🔌\n\nRun the following command in the root directory of your project\n\n    npm install influx-backup --save\n\n\n## Usage 🔧\n\nCheck [JSDocs](https://robertslando.github.io/node-influxdb-backup/) and the Express [example](https://github.com/robertsLando/node-influxdb-backup/tree/master/examples).\n\nHere are some lines from `examples/app.js`\n\n```javascript\n\nconst BackupManager = require('influx-backup');\n\nconst TEST_DB = \"testDB\";\n\nconst manager = new BackupManager({db: TEST_DB});\n\n// Restore DB api\napp.post('/restore', (req, res) =\u003e {\n\n  var restore_path = \"\";\n\n  // create a temp directory to use for the backup\n  manager.createDir()\n  .then((dir) =\u003e {\n\n    restore_path = dir;\n\n    // Use multer to get the file from the req\n    // and store it in the temp dir created\n    var Storage = multer.diskStorage({\n      destination: restore_path,\n      filename: function(req, file, callback) {\n        callback(null, file.originalname);\n      }\n    });\n\n    // \"restore\" is the name attr of input file in html\n    var upload = multer({storage: Storage}).single(\"restore\");\n\n    return multerPromise(upload, req, res)\n  })\n  .then((file) =\u003e {\n    //now the file is stored correctly, I can start the restore command\n    if(file){\n      return manager.restore(restore_path, file.originalname)\n    }else{\n      throw Error(\"No file provided\");\n    }\n  }) //the backup has been restored in a backup database, load the backup in the main database\n  .then(() =\u003e manager.loadBackup())\n  .then(() =\u003e res.json({success:true, message: \"Backup restored successfully\"}))\n  .catch(err =\u003e {\n    console.log(err);\n    res.json({success:false, message: err.message})\n  });\n});\n\n// Backup DB api\napp.get('/backup', (req, res) =\u003e {\n\n  manager.backup()\n  .then((file) =\u003e {\n    //zip file is ready, send it to the client\n    var stream = fs.createReadStream(file);\n\n    res.setHeader('Content-disposition', 'attachment; filename=' + file.split('/').pop());\n\n    stream.once(\"close\", function () {\n      stream.destroy(); // makesure stream closed, not close if download aborted.\n      //IMPORTANT: remove backup files and zip\n      manager.deleteDir(path.dirname(file));\n    });\n\n    stream.pipe(res);\n  })\n  .catch(err =\u003e {\n    res.json({success: false, message: err});\n  });\n\n});\n\n// Check testDB exists, if not create one and start app listening on port 8000\ninflux.getDatabaseNames()\n.then(names =\u003e {\n  if (!names.includes(TEST_DB)) {\n    return influx.createDatabase(TEST_DB)\n  }\n})\n.then(() =\u003e manager.init())\n.then(() =\u003e {\n  app.listen(8000, function () {\n    console.log('Listening on port 8000')\n  })\n})\n.catch(err =\u003e {\n  console.error(`Error creating Influx database!`)\n})\n\n```\n\n## FAQ ❓\n\n**Q: Why I can't restore directly to the main database?**\n\n*A: Actually InfluxDB doesn't allows to restore data in an existing database, the\n only way to do this is to load the backup in a temporary database and than use\n a query to load the data from the temporary database to the existing one. More details [here](https://docs.influxdata.com/influxdb/v1.7/administration/backup_and_restore/#restore-examples)*\n\n## Author :bowtie:\n\n[Daniel Lando](https://github.com/robertsLando)\n\nSupport me on [Patreon](https://www.patreon.com/join/2409916) :heart:\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobertslando%2Fnode-influxdb-backup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobertslando%2Fnode-influxdb-backup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobertslando%2Fnode-influxdb-backup/lists"}