verbb / hyper

A Craft CMS plugin for managing links, focusing on user experience.
Other
21 stars 9 forks source link

Trying to migrate from Typed Link Field gives Shell Command Failure #23

Closed Antimated closed 1 year ago

Antimated commented 1 year ago

Describe the bug

I created a Craft install from our internal starter project which contains the following typed link scenario's

The shell command "mysqldump --defaults-file="/var/tmp/vopnhxfcujyo.cnf" --add-drop-table --comments --create-options --dump-date --no-autocommit --routines --default-character-set=utf8 --set-charset --triggers --no-tablespaces --single-transaction --no-data --result-file="/Users/nicholas/Sites/hyper/storage/backups/hyper--2023-02-28-105631--v4.3.10.sql" crft_hyper && mysqldump --defaults-file="/var/tmp/vopnhxfcujyo.cnf" --add-drop-table --comments --create-options --dump-date --no-autocommit --routines --default-character-set=utf8 --set-charset --triggers --no-tablespaces --single-transaction --no-create-info --ignore-table=crft_hyper.assetindexdata --ignore-table=crft_hyper.imagetransformindex --ignore-table=crft_hyper.resourcepaths --ignore-table=crft_hyper.sessions --ignore-table=crft_hyper.cache crft_hyper >> "/Users/nicholas/Sites/hyper/storage/backups/hyper--2023-02-28-105631--v4.3.10.sql"" failed with exit code 127: sh: mysqldump: command not found

Screenshot 2023-02-28 at 11 57 54

Steps to reproduce

Try and migrate from Typed Link Field to Hyper

Craft CMS version

4.3.10

Plugin version

1.0.4

Multi-site?

No

Additional context

engram-design commented 1 year ago

This would be because we try to take a backup of your database before beginning the migration - which is pretty important in case you need to roll back.

What's your local dev environment? This is related to MAMP but should be applicable to other similar setups.

Antimated commented 1 year ago

This would be because we try to take a backup of your database before beginning the migration - which is pretty important in case you need to roll back.

What's your local dev environment? This is related to MAMP but should be applicable to other similar setups.

I'm running laravel valet :)

engram-design commented 1 year ago

I might recommend some tips from Craft on that https://github.com/craftcms/cms/issues/5310

Antimated commented 1 year ago

Yeah that was the culprit! Added this putenv("PATH={$_SERVER["PATH"]}:/usr/local/opt/mysql@5.7/bin"); to my general.php file so I could locally migrate the typed link fields!

engram-design commented 1 year ago

Nice one, and yeah probably a good idea in general to have that work, so that Craft can make backups when you update it along the way.

WHITE-developer commented 4 months ago

@engram-design Would it be possible to maybe let the Backup command listen to the backupOnUpdate config setting or a custom one, We don't have mysqldump installed on our servers (docker) so we are unable to run it now

engram-design commented 4 months ago

I'll make this a custom setting, as backupOnUpdate probably doesn't seem like the right fit.

Added backupOnMigrate plugin setting. To get this early run composer require verbb/hyper:"dev-craft-4 as 1.1.21"