instride-ch / pimcore-data-definitions

Data Definitions Plugin for Pimcore
Other
78 stars 58 forks source link

All saved DataDefinitions in- and exports are missing when upgrading Pimcore from 10.6.x to 11.x #411

Closed Hbitvof closed 1 month ago

Hbitvof commented 9 months ago

After upgrade Pimcore from 10.6.x to 11.x and also updating Datadefinitions to 5.x all saved DataDefinitions in- and exports are missing and the Add button is grayed out:

image

It seems other persons also have the some kind of issues: https://github.com/instride-ch/DataDefinitions/issues/400

Can this be fixed soon? At the moment we are unable to update to Pimcore 11.x based on this problem because we use DataDefinitions to import many different datafeeds into Pimcore.

dkarlovi commented 6 months ago

Can this be fixed soon?

PRs welcome.

Hbitvof commented 5 months ago

Can this be fixed soon?

PRs welcome.

I can't provide you with a PR. It seems DataDefinitions is just not ready for Pimcore 11 and it would be nice this will be changed soon. There seems no development in this tool anymore and that's sad :(.

dkarlovi commented 5 months ago

@Hbitvof DataDefinitions works on Pimcore 11 since #399.

Hbitvof commented 5 months ago

@Hbitvof DataDefinitions works on Pimcore 11 since #399.

Most of the users are upgrading from a previous version of Pimcore and then it doesn't work. There are more users reporting on the same issue. So this software is not usable for the most persons on Pimcore 11.

dkarlovi commented 5 months ago

I don't have access to these stats you're talking about so can't judge what "most persons" experience, I can only react to your claim

DataDefinitions is just not ready for Pimcore 11

as false since we're using it with Pimcore 11 since #399.

dpfaffenbauer commented 1 month ago

DataDefs is Pimcore 11 ready. I am pretty sure this issue is fixed.

Hbitvof commented 1 month ago

DataDefs is Pimcore 11 ready. I am pretty sure this issue is fixed.

This is still not solved. Is there any information I can provide from our environment to figure out what goes wrong when upgrading from a previous version?

dpfaffenbauer commented 1 month ago

there is a migration command from the old .php configs to yaml configs

Hbitvof commented 1 month ago

there is a migration command from the old .php configs to yaml configs

Can you provide this command? I don't see any upgrade instructions anymore in the readme of Data Definitions.

dpfaffenbauer commented 1 month ago

https://github.com/instride-ch/pimcore-data-definitions/blob/5.0/src/DataDefinitionsBundle/Command/ConvertImportDefinitionsToYaml.php https://github.com/instride-ch/pimcore-data-definitions/blob/5.0/src/DataDefinitionsBundle/Command/ConvertExportDefinitionsToYaml.php

bin/console data-definition:configuration:importer:convert-to-yaml
bin/console data-definition:configuration:exporter:convert-to-yaml
Hbitvof commented 1 month ago

https://github.com/instride-ch/pimcore-data-definitions/blob/5.0/src/DataDefinitionsBundle/Command/ConvertImportDefinitionsToYaml.php https://github.com/instride-ch/pimcore-data-definitions/blob/5.0/src/DataDefinitionsBundle/Command/ConvertExportDefinitionsToYaml.php

bin/console data-definition:configuration:importer:convert-to-yaml
bin/console data-definition:configuration:exporter:convert-to-yaml

These commands give errors:

[]# bin/console data-definition:configuration:importer:convert-to-yaml 11:14:33 WARNING [php] Warning: file_put_contents(var/config/import-definitions/1.yaml): Failed to open stream: No such file or directory ["exception" => ErrorException { …}] 11:14:33 WARNING [php] Warning: file_put_contents(var/config/import-definitions/2.yaml): Failed to open stream: No such file or directory ["exception" => ErrorException { …}] 11:14:33 WARNING [php] Warning: file_put_contents(var/config/import-definitions/3.yaml): Failed to open stream: No such file or directory ["exception" => ErrorException { …}] 11:14:33 WARNING [php] Warning: file_put_contents(var/config/import-definitions/4.yaml): Failed to open stream: No such file or directory ["exception" => ErrorException { …}] 11:14:33 WARNING [php] Warning: file_put_contents(var/config/import-definitions/5.yaml): Failed to open stream: No such file or directory ["exception" => ErrorException { …}] 11:14:33 WARNING [php] Warning: file_put_contents(var/config/import-definitions/6.yaml): Failed to open stream: No such file or directory ["exception" => ErrorException { …}] 11:14:33 WARNING [php] Warning: file_put_contents(var/config/import-definitions/7.yaml): Failed to open stream: No such file or directory ["exception" => ErrorException { …}] 11:14:33 WARNING [php] Warning: file_put_contents(var/config/import-definitions/8.yaml): Failed to open stream: No such file or directory ["exception" => ErrorException { …}] 11:14:33 WARNING [php] Warning: file_put_contents(var/config/import-definitions/9.yaml): Failed to open stream: No such file or directory ["exception" => ErrorException { …}] 11:14:33 WARNING [php] Warning: file_put_contents(var/config/import-definitions/10.yaml): Failed to open stream: No such file or directory ["exception" => ErrorException { …}] 11:14:33 WARNING [php] Warning: file_put_contents(var/config/import-definitions/11.yaml): Failed to open stream: No such file or directory ["exception" => ErrorException { …}] 11:14:33 WARNING [php] Warning: file_put_contents(var/config/import-definitions/12.yaml): Failed to open stream: No such file or directory ["exception" => ErrorException { …}] 11:14:33 WARNING [php] Warning: file_put_contents(var/config/import-definitions/13.yaml): Failed to open stream: No such file or directory ["exception" => ErrorException { …}] 11:14:33 WARNING [php] Warning: file_put_contents(var/config/import-definitions/14.yaml): Failed to open stream: No such file or directory ["exception" => ErrorException { …}] 11:14:33 WARNING [php] Warning: file_put_contents(var/config/import-definitions/15.yaml): Failed to open stream: No such file or directory ["exception" => ErrorException { …}] 11:14:33 WARNING [php] Warning: file_put_contents(var/config/import-definitions/16.yaml): Failed to open stream: No such file or directory ["exception" => ErrorException { …}] YAML import definitions configurations are generated under: var/config/import-definitions []# bin/console data-definition:configuration:exporter:convert-to-yaml 11:14:52 WARNING [php] Warning: file_put_contents(var/config/export-definitions/2.yaml): Failed to open stream: No such file or directory ["exception" => ErrorException { …}] 11:14:53 WARNING [php] Warning: file_put_contents(var/config/export-definitions/3.yaml): Failed to open stream: No such file or directory ["exception" => ErrorException { …}] 11:14:53 WARNING [php] Warning: file_put_contents(var/config/export-definitions/4.yaml): Failed to open stream: No such file or directory ["exception" => ErrorException { …}] 11:14:53 WARNING [php] Warning: file_put_contents(var/config/export-definitions/5.yaml): Failed to open stream: No such file or directory ["exception" => ErrorException { …}] 11:14:53 WARNING [php] Warning: file_put_contents(var/config/export-definitions/6.yaml): Failed to open stream: No such file or directory ["exception" => ErrorException { …}] 11:14:53 WARNING [php] Warning: file_put_contents(var/config/export-definitions/7.yaml): Failed to open stream: No such file or directory ["exception" => ErrorException { …}] 11:14:53 WARNING [php] Warning: file_put_contents(var/config/export-definitions/8.yaml): Failed to open stream: No such file or directory ["exception" => ErrorException { …}] YAML export definitions are generated under: var/config/export-definitions

And I still have the same issue I am unable to add an import or export defenition because the Add button is not active.

dpfaffenbauer commented 1 month ago

@Hbitvof Regarding the commands, if you create the folder var/config/import-definitions and var/config/export-definitions, does it work then?

Regarding the backend: Might be the same Problem?

Hbitvof commented 1 month ago

@Hbitvof Regarding the commands, if you create the folder var/config/import-definitions and var/config/export-definitions, does it work then?

Regarding the backend: Might be the same Problem?

That's working. I have both the import and export definitions back! But I am still unable to add a definition. The Add button is still not active.

dpfaffenbauer commented 1 month ago

We use the default Pimcore behaviour for writing these settings. Basically this code is responsible for it: https://github.com/pimcore/pimcore/blob/56f8f152e5f0cead1f003b93d814e26279335505/lib/Config/LocationAwareConfigRepository.php#L122

So you can see it is only writeable when write target is a Symfony Config and its in debug mode. So what you can do is, you can migrate yours to the settings store. or at least the new ones by adding this config:

yaml data_definitions: config_location: import_definitions: write_target: type: settings-store export_definitions: write_target: type:settings-store


If you just add this config, the existing definitions might be gone. So with this line, you can add the existing ones:

imports:

But, you cannot edit YAML Definitions from the backend then.

Reason for these changes in Pimcore: These are files a developer creates locally, adds them to a docker container and deployes them. If somebody changes them on the stage/prod system, they only change it temporarily until the container restarts. so you have to disable the edit function for those files.

Hbitvof commented 1 month ago

When changing to debug mode I am able to add definitions. This wasn't needed in the previous version of PimCore. Now everything is working!

dpfaffenbauer commented 1 month ago

Sorry, we just follow the way Pimcore handles it...