Bonus System

Migration of points

This guide outlines the process of migrating points from another shop system to Shopware 6. It is intended for developers and system administrators involved in system migration tasks.

Importing points into Shopware 6

Points from other systems can be taken over. To do so, fill the database table prems_bonus_system_import_point with the entries from the legacy system.

Fields of the table:

Field Type Required Description
id binary(16) yes Unique ID.
customer_number varchar yes Customer number as stored in Shopware 6.
points int yes Points to credit to the customer account.
reason text optional Booking reason, max. 255 characters — for example “Migration” or “Legacy points”.
created_at datetime(3) yes Creation timestamp.

Once the table is filled, run the import on the console:

bin/console prems:bonus-system:import-points-from-db-table

The command processes the table in batches. Repeat it until no entries are left in prems_bonus_system_import_point.

Do not run prems:bonus-system:recalculate-points after a migration — the imported points would be removed.

Example: migrating from Shopware 5

Read the points from the legacy shop system:

SELECT 
    UUID() AS id, 
    u.customernumber AS customer_number, 
    up.points AS points, 
    "Migration" AS reason 
FROM s_core_plugins_bonus_user_points AS up 
LEFT JOIN s_user AS u 
ON up.userID = u.id;

Export the points (for example as CSV) and encode them as UTF-8. Then import the CSV file into the Shopware 6 table prems_bonus_system_import_point and run the import command.

Checks after the import

  • Marketing → Bonus system → Customers: are the balances of individual customers correct?
  • Marketing → Bonus system → Credits: do the import bookings appear with the chosen reason, and are they activated?
  • If a lifetime is configured under Point expiration, it is calculated from the booking date — check whether imported points would expire immediately.