Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ jobs:
- run: docker compose logs
if: always()
- run: npm run migrate
- run: npm run import-data
- run: npm run build
- run: >-
docker build
Expand Down
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ RUN npm ci
COPY .next .next
COPY scripts/ scripts/
COPY src/ src/
COPY export/ export/
COPY tsconfig.json tsconfig.json

EXPOSE 3000
Expand Down
33 changes: 2 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,35 +52,6 @@ npm run build
npm run standalone
```

## Data Export
## Data source

Exports all import/export-enabled Payload collections as JSON files into [`export/`](./export).

```powershell
npm run export-data
```

Notes:

- The script requires a valid Payload user.
- The script loads environment variables from your Next.js `.env` files.
- Existing JSON files in `export/` are overwritten.

## Data Import

Imports all `*.json` files from [`export/`](./export) into the matching Payload collections.

```powershell
npm run import-data
```

Notes:

- The database schema / tables must already exist before running the import.
- Run `npm run migrate` first if the target database is still empty.
- The script always creates or reuses a temporary Payload user for the import process.
- The script uses `upsert` with `matchField: "id"`.
- If a document with the same `id` already exists, it is updated.
- If no document with that `id` exists, it is created.
- Existing documents with different IDs remain untouched.
- JSON files without a matching import-enabled collection are skipped.
Content is loaded directly from the configured Postgres database via Payload queries.
1 change: 0 additions & 1 deletion export/blog.json

This file was deleted.

1 change: 0 additions & 1 deletion export/cookie-banner.json

This file was deleted.

1 change: 0 additions & 1 deletion export/features.json

This file was deleted.

1 change: 0 additions & 1 deletion export/footer.json

This file was deleted.

1 change: 0 additions & 1 deletion export/jobs.json

This file was deleted.

Loading