@jalsoedesign/daf-converter
v1.0.0
Published
Convert Duplicator / Duplicator Pro dup-archive (.daf) backups into .zip files or folders, or extract just the WordPress database as .sql
Maintainers
Readme
@jalsoedesign/daf-converter
Convert Duplicator / Duplicator Pro dup-archive (.daf) backups into a regular .zip, a folder, or just the WordPress database as plain .sql. No PHP, no installer.php and no WordPress needed.
📖 Docs: https://jalsoedesign.github.io/daf-converter/
Install
npm i -g @jalsoedesign/daf-converterRequires Node.js 18 or newer. This installs three commands:
| Command | What it does |
| --- | --- |
| daf-to-zip | Turns a .daf into a .zip that any OS or unzip tool can open |
| daf-to-folder | Extracts every file (WordPress files plus dup-installer/) into a folder |
| daf-to-sql | Extracts only the database dump, as an uncompressed MySQL/MariaDB .sql script |
Usage
daf-to-zip backup_archive.daf # -> backup_archive.zip
daf-to-zip backup_archive.daf site.zip
daf-to-folder backup_archive.daf # -> ./backup_archive/
daf-to-folder backup_archive.daf ./site
daf-to-sql backup_archive.daf # -> backup_archive.sql
daf-to-sql backup_archive.daf database.sqlAll commands accept -q, --quiet, -h, --help and -v, --version.
Run a command once without installing:
npx -p @jalsoedesign/daf-converter daf-to-sql backup_archive.dafAPI
import {dafToZip, dafToFolder, dafToSql} from '@jalsoedesign/daf-converter';
await dafToZip('backup_archive.daf', 'backup.zip'); // Promise<boolean>
await dafToFolder('backup_archive.daf', './site'); // Promise<boolean>
await dafToSql('backup_archive.daf', 'database.sql'); // false if there is no database dumpSee the API docs for DupArchiveReader, which reads entries one by one.
Development
npm install
npm run dev # rebuild dist/ on every change
npm run sql -- backup_archive.daf out.sql # run a command straight from src/, no build needed (also: zip, folder)
npm run typecheck
npm run build
npm run docs:dev # docs with live reload| Path | What it is |
| --- | --- |
| src/DupArchiveReader.ts | Reads the .daf format |
| src/converters/ | dafToZip, dafToFolder, dafToSql |
| src/cli/ | The three commands |
| docs/ | VitePress site, deployed to GitHub Pages by .github/workflows/docs.yml |
Publishing
npm login
npm version patch # or minor / major
npm publish # runs typecheck and build firstSecurity note
Duplicator backups contain your full database, including user password hashes, and a copy of wp-config.php with database credentials. Treat the .daf and everything converted from it as sensitive.
License
MIT. Not affiliated with Duplicator or Snap Creek. "# daf-converter-ts" "# daf-converter-ts"
