I'm unable to export impexscript due to error:
de.hybris.platform.impex.jalo.ImpExException: line 3 at main script: No valid line type found for {0=, 1=user_to_test_export}
This is how I'm doing export of my data using impex
String impexScript = String.format("INSERT Customer;uid[unique=true];\n" +
";%s", customer.getUid());
ImpExMedia impExMedia = ImpExManager.getInstance().createImpExMedia("test_importexport_exportscript");
impExMedia.setData(new ByteArrayInputStream(impexScript.getBytes()), "CustomerData", "text/csv");
ExportConfiguration config = new ExportConfiguration(impExMedia, ImpExManager.getExportOnlyMode());
Exporter exporter = new Exporter(config);
exporter.export();
User/Customer can be easily exported via groovy.
import de.hybris.platform.impex.jalo.*
import de.hybris.platform.impex.jalo.exp.ExportConfiguration
import de.hybris.platform.impex.jalo.exp.Exporter
import de.hybris.platform.impex.jalo.exp.Export
String impexScript = String.format("INSERT Customer;uid[unique=true]");
ImpExMedia impExMedia = ImpExManager.getInstance().createImpExMedia("test_importexport_exportscript");
impExMedia.setData(new ByteArrayInputStream(impexScript.getBytes()), "CustomerData", "text/csv");
ExportConfiguration config = new ExportConfiguration(impExMedia, ImpExManager.getExportOnlyMode());
Exporter exporter = new Exporter(config);
Export export = exporter.export();
println(export.getExportedData())
Note: run groovy in commit mode.
Sample Output:
data_export_1676281713548(data_export_1676281713548(8798244438046))
With this PK 8798244438046
ImpExMedia can be search easily in Backoffice.