Clean-up
Pacemaker Community Edition provides a clean-up function that removes values for empty columns or relations that are no longer part of the CSV file.
Deleting data can significantly impact performance; the clean-up function should get used with caution. |
It is recommended to use the |
Product import
- The clean-up functionality for product import is enabled by default and available for the following listed areas and all product attributes (
clean-up-empty-columns
) that require additional configuration:
Images |
Clean-up images |
|
Media gallery |
Clean-up media gallery |
|
Category Relations |
Clean-up category relations |
|
Website Relations |
Clean-up website relations |
|
Tier Prices |
Clean-up tier prices |
|
URL Rewrites |
Clean-up URL rewrites |
|
Clean-up empty columns |
Clean-up empty columns for product attributes and additional attributes |
Images/Media gallery
It is helpful to delete images that are no longer included in the CSV files from the database most of the time.
- The Image type, e.g., is stored in different tables:
-
-
Thumbnail as an attribute
-
Links to the product
-
As well as name and position
-
Category relations
In many cases, the product category relationships do not change infrequently.
Suppose the product category relationships change frequently, and it is necessary to update them with the
add-update
operation.
Example
- That can get performed by setting the
clean-up-category-product-relations
flag totrue
:
...
"params": {
...,
"clean-up-category-product-relations": "true"
},
...
Since the product-category relation gets not persist to only one column, this relation cannot be
cleaned-up by adding a column name to the |
Website relations
Suppose the product-website relationships change frequently, and it becomes necessary to update them with
the add-update
operation.
Example
- In that case, that can get achieved by setting the
clean-up-website-product-relations
flag totrue
:
...
"params": {
...,
"clean-up-website-product-relations": "true"
},
...
Since the product-website-relationship gets not persist to only one column, that relationship cannot be cleaned up
by adding a column name to the |
Categories
Since the category functionality in Magento is more basic, the clean-up only provides a flag for the URL rewrites.
Example
- As with the product import, the flags must get configured at the subject level, e.g.:
{
"operations": {
"ce": {
"catalog_category": {
"add-update.url-rewrite": {
"plugins": {
"subject": {
"id": "import.plugin.subject",
"subjects": [ (1)
{
"id": "import_category.subject.bunch",
"file-resolver": {
"prefix": "category-url-rewrite"
},
"params": {
"clean-up-url-rewrites": "false" (2)
},
"observers": [
{
"import": [
"import_category.observer.url.rewrite.update"
]
}
]
}
]
}
}
}
}
}
}
}
1 | Subject level |
2 | Url rewrites flag is set to false |
Clean-up empty columns
Comma seperated ( ,
) array list to define empty values for
product attributes and
additional attributes
Be aware that the columns specified in
|
Disable clean-up
Example
- To disable the clean-up function, add the following snippet and overwrite the corresponding
clean-up-*
flags in<custom-configuration-dir>/operations.json
:
"ce": {
"catalog_product": {
"add-update": {
"plugins": {
"subject": {
"id": "import.plugin.subject",
"subjects": [
{
"id": "import_product.subject.bunch",
"file-resolver": {
"prefix": "product-import"
},
"params": {
"copy-images": false, (1)
"clean-up-media-gallery": false, (2)
"clean-up-empty-image-columns": false, (3)
"clean-up-website-product-relations": false, (4)
"clean-up-category-product-relations": false, (5)
"clean-up-empty-columns": [] (6)
},
"observers": [
{
"import": [
"import_product.observer.composite.base.add_update"
]
}
]
}
]
}
}
}
}
}
1 | Disable copy-images clean-up |
2 | Disable clean-up-media-gallery clean-up |
3 | Disable clean-up-empty-image-columns clean-up |
4 | Disable clean-up-website-product-relations clean-up |
5 | Disable clean-up-category-product-relations clean-up |
6 | See described clean-up-empty-columns option array format for empty fields |