Skip to content

Using Bulk Importer/Exporter

Open Automation > Bulk Importer in the admin area. The page Bulk Importer & Exporter lists all runs, newest first. Customers see nothing of this extension.

A run executes immediately when you save the form, inside that page request. There is no queue and no scheduled task. When the run has finished you are returned to the list.

Run an import

  1. Click New Run.
  2. Enter a Run Name, leave Operation on Import and choose the Entity.
  3. Leave Dry Run (no data changes) switched on for the first attempt.
  4. Upload the Import File and choose the Format, or leave it on Auto detect.
  5. Set the format options: header row and delimiter for CSV, JSON path (optional) for JSON, XML record path (optional) for XML.
  6. Choose the Update match field.
  7. Add one Column Mapping row per field you want to import.
  8. Click Create. The run executes and the notification Import run finished appears.
  9. Check the status, the row counts and the Summary column in the list.
  10. If the dry run shows no failed rows, create a new run with the same options and Dry Run (no data changes) switched off.

A run cannot be edited or started again. View opens the page Import Run Details, which shows the options and the Run Summary but has no save button. To repeat an import, create a new run.

Warning

A live import overwrites every field of the entity on records it updates, not only the fields you mapped. Target fields you leave out of the mapping are saved as empty. For example, updating users without mapping role_id removes the role from matching admin accounts. The only exception is the user password, which is kept when no password is supplied. Map all fields you want to keep, and export the entity first so you have a copy.

What a dry run checks

A dry run applies the mapping and the transforms and then checks the required fields of the entity (see the tables below). It does not look up existing records, so it does not report a missing match field or a product category that does not exist. Those errors appear only in a live import.

File formats

CSV. With a header row, the column names of the first line are the source names. Without one, use column_1, column_2 and so on. If a line has fewer values than the header, the missing ones are empty.

JSON. The file must contain an array of objects, or an object that contains one. If JSON path (optional) is empty and the root is an object, the first property that holds a list is used as the records. Entries that are not objects are ignored.

XML. The path is resolved below the root element. For this file the record path is record:

<records>
  <record><code>WELCOME10</code><type>percentage</type><value>10</value></record>
  <record><code>SUMMER5</code><type>fixed</type><value>5</value></record>
</records>

If the path is empty, the first repeated child element of the root is used. Exports written by this extension have exactly this structure.

Target fields per entity

Only these fields can be chosen as Target field.

Users (required: email, which must be a valid e-mail address)

Target field Notes
first_name
last_name
email Saved in lower case
password Plain text in the file; stored hashed. If empty for a new user, a random 16-character password is set. If empty for an existing user, the current password is kept.
role_id ID of a Paymenter role. Empty means no role (a normal customer).
email_verified_at Date and time. Empty means not verified.

Categories (required: slug, name)

Target field Notes
slug
name
description
parent_slug Slug of the parent category. If no category with this slug exists, the category is saved without a parent and no error is reported. Import parents before children.
sort Whole number
image Saved as given; no file is uploaded

Products (required: name, category_slug)

Target field Notes
category_slug Slug of an existing category. If it does not exist, the row fails in a live import.
name
slug If not mapped, the slug is generated from the name
description
stock Whole number, empty for unlimited
per_user_limit Whole number
allow_quantity disabled, separated or combined. Any other value is saved as disabled.
server_id ID of a Paymenter server
image Saved as given; no file is uploaded
sort Whole number
email_template

Prices and plans are not imported. Add them in Paymenter after the import.

Coupons (required: code, type; type must be percentage or fixed)

Target field Notes
code Saved in upper case
type percentage or fixed
value Decimal number
recurring Whole number. If not supplied, 1 is saved.
max_uses Whole number, empty for unlimited
max_uses_per_user Whole number. Only written if your Paymenter version has this coupon column.
applies_to all, price or setup_fee; any other value becomes price. See the note below.
starts_at Date and time
expires_at Date and time

Note

The extension passes applies_to to Paymenter's coupon model through mass assignment. In the Paymenter source these docs were checked against, the coupon model does not accept applies_to that way, so the value is dropped and new coupons get Paymenter's database default. Check Applies To on imported coupons.

Statuses and counts

Status Meaning
pending The run was saved and has not started
running The run is being processed
dry_run_completed Dry run finished with no failed rows
completed Live import or export finished with no failed rows
completed_with_errors Some rows succeeded and some failed
failed Every row failed, or the run stopped before processing rows. The Summary column shows the reason.

The Mode column shows Dry run, Live import or Export. Rows, Success, Failed and Skipped count the rows of the file. A row counts as skipped only when the mapping produces no target field for it.

The summary of an import reads, for example, Rows: 120, Success: 118, Failed: 2, Skipped: 0. A dry run adds Dry run mode: no data was written.

Row logs

For every processed row the extension stores the row number, the status, a message and the row data in the table ext_bulk_import_row_logs. Messages are, for example, Created user #42, Updated product #7, Dry run row validated. or Row 14: Validation failed for "email": invalid format "john@@mail".

The admin area does not show these row logs; it shows only the counts and the summary. To see which rows failed and why, query the table:

SELECT row_number, message
FROM ext_bulk_import_row_logs
WHERE import_run_id = 12 AND status = 'failed'
ORDER BY row_number;

The run ID is the number in the address of the Import Run Details page. Row numbers count data rows, starting at 1; a CSV header line is not counted.

Run an export

  1. Click New Run.
  2. Enter a Run Name, set Operation to Export and choose the Entity.
  3. Choose the Format. For CSV, set Include CSV header row and CSV delimiter.
  4. For a user export, optionally pick users under Exclude users from export.
  5. Click Create. The notification Export run finished appears.
  6. In the list, click Download on the run.

An export always contains all records of the entity, ordered by ID, except excluded users. Download is shown only for export runs with status completed whose file still exists on disk.

The file is written to storage/app/tmp/bulk-importer/exports with a name such as bulk-export-20260208-141503-a1B2c3.csv. JSON exports are an array of objects. XML exports have a <records> root with one <record> element per row.

Export columns per entity

Entity Columns
Users id, first_name, last_name, email, role_id, email_verified_at, created_at, updated_at
Categories id, slug, name, description, parent_id, parent_slug, sort, image, created_at, updated_at
Products id, category_id, category_slug, name, slug, description, stock, per_user_limit, allow_quantity, server_id, image, sort, email_template, created_at, updated_at
Coupons id, code, type, value, recurring, max_uses, starts_at, expires_at, created_at, updated_at, and max_uses_per_user and applies_to if your Paymenter version has these columns

Dates are written as YYYY-MM-DD HH:MM:SS. User passwords are not exported.

An export file can be used as an import file: the column names match the target fields, so you map email to email, category_slug to category_slug and so on.

Delete runs

Delete on a row or on the details page removes the run and its row logs. You can also select several runs and delete them together. Deleting a run does not delete its uploaded import file or its export file from storage/app/tmp/bulk-importer, and it does not undo an import.