# Migration of points

### Import of Points into Shopware 6

It is possible to transfer points from other systems to Shopware6. For this, the database table **prems\_bonus\_system\_import\_point** must be populated with entries from the external system.

#### Mandatory Fields for Import

It is possible to transfer points from other systems to Shopware 6. For this, the database table **prems\_bonus\_system\_import\_point** must be populated with entries from the external system. This allows for the import of points into Shopware 6.

* id (binary(16))
* customer\_number (int)
* points (int)
* reason (string, optional)
* created\_at (datetime(3))

After the table is filled, the following command must be executed on the console: Optionally, the field "reason" can be filled with text up to 255 characters long. This text will later appear to customers as the reason for the booking. The text could be something like "Migration" or "Points Transfer from Legacy System".

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

If necessary, repeat the command multiple times until no entries remain in the table

### Migration of Points Using Shopware 5 as an Example

```
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 (if necessary as CSV) and encode to UTF 8.&#x20;

In the Shopware 6 database, import the CSV file into the database table prems\_bonus\_system\_import\_point.&#x20;

Then execute the command on the console:

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.premsoft.de/en/plugins/bonus-system/migration-of-points.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
