Skip to content

Data, backup and seeding

AutoTestX stores everything as files in one folder: ATX_DATA_DIR. The default is .data in the project folder; on a deployed server it is /var/lib/autotestx. There is no database to set up.

Path Contents
organizations.json, projects.json Organizations, projects and their suite lists
organization-users.json, project-users.json Who belongs where, with which role
members.json Sign-in accounts (names, emails, platform role). No credentials.
credentials.json Password hashes (scrypt). Sensitive.
sessions.json, password-resets.json Session and reset tokens (SHA-256 digests only). Sensitive.
tests/<id>/ Each test: current version and every previous version
components/<id>/ Each component and its immutable versions
environments/<id>.json Environments, including secret values. Sensitive.
applications.json Applications
test-data/<id>.json Data sets
data-pools.json Data pools and every record’s state
runs/<id>/ run.json (result) and artifacts/ (screenshots). Data-driven runs add rows/<n>.json and artifacts/r<n>/.
recordings/ End-of-recording preview screenshots
files/ Files that Upload file steps use (relative paths)
language/ Write-with-AI examples learned per project
agents.json Paired agent computers
audit.log Refused cross-project access attempts

Shared files (accounts, sessions, organizations, pools…) are written through a temporary file and a rename, so a crash cannot leave them half-written. Test, run and environment files are written directly. Back up regularly, as below.

Protect the data folder. It holds secret values and password hashes. The deployment script sets it to mode 700, owned by the autotestx service user. Never commit it. .gitignore excludes the credential files.

Back up the whole data folder. A consistent copy is simplest with the service stopped:

Terminal window
sudo systemctl stop autotestx
sudo tar -czf /root/autotestx-data-$(date +%F).tgz -C /var/lib autotestx
sudo systemctl start autotestx

runs/ grows with every run (screenshots). There is no automatic retention policy yet. Archive or delete old run folders if disk space matters; the tests themselves are unaffected.

On AWS Lightsail, automatic instance snapshots cover the data folder too.

  1. Install AutoTestX on the new server (see Deployment).
  2. Stop the service, copy the data folder into ATX_DATA_DIR, and fix ownership: sudo chown -R autotestx:autotestx /var/lib/autotestx.
  3. Start the service.

setup-server.sh can also import a data bundle on first install, into an empty data folder only: sudo DOMAIN=… bash setup-server.sh /tmp/autotestx.tgz /tmp/autotestx-data.tgz.

Give each its own ATX_DATA_DIR and PORT, e.g. a training copy:

Terminal window
$env:PORT = "4150"; $env:ATX_DATA_DIR = ".data-training"; npm start

The repository ships with complete, runnable examples. Seed scripts import them into a project through the same validation and storage the server uses:

Command Imports
npm run seed:api-examples -- <projectId> <ownerUserId> [--run] Demo API environment and four API tests (examples/api-demo)
npm run seed:data-driven-examples -- <projectId> <ownerUserId> [--run] Data sets, a data pool and five data-driven tests (examples/data-driven)
node --import tsx scripts/seed-custom-code-examples.mts <projectId> <ownerUserId> [--run] Seven custom-code tests (examples/custom-code)
node --import tsx scripts/seed-components.mts <projectId> <ownerUserId> [environmentId] Login and Add PO Line components, callers, a v2 and an upgrade
node --import tsx scripts/seed-composite-component.mts <projectId> <ownerUserId> [environmentId] A component built from components, plus a caller (run after the previous one)
  • npm run seed:data-driven-examples with no arguments lists projects and member ids.
  • --run (or an environmentId for the component scripts) also runs what was imported. The API, data-driven and custom-code examples need the demo API: npm run demo:api.
  • The component examples need an environment pointing at the fixture app with APP_USER / APP_PASSWORD (see Your first test).
  • Everything is matched by name, so running a script twice changes nothing.
  • Set ATX_DATA_DIR the same way as for the server you are seeding.

Stop the server first, or restart it afterwards. The server keeps several data files in memory and writes them back whole. A seed script that writes while the server runs is invisible to it until a restart, and the server’s next write to the same file (for example data-pools.json when a pool is used) overwrites what the script added.