Closed Vandemonica closed 5 months ago
@Vandemonica are you running this via DDEV, or something else?
no, just the normal craft command, ran with windows 10 CMD
this one
php craft db/backup
@Vandemonica Sorry... does that mean Craft is installed on your native Windows host OS and you've installed Apache or are using IIS and MySQL on the host machine? i.e. no WSL, Lando, WAMP, etc.
I'm unable to reproduce with DDEV on Windows, so trying to get as close to your setup as possible.
Kinda, I used Laragon with Nginx 1.22.1 as webserver
I have just upgraded to 4.9.5 from 4.8.something and I am getting the same issue when I try to run a backup. I also got the same on a Craft 5 installation.
2024-06-03 13:38:33 [web.ERROR] [yii\base\Exception] yii\base\Exception: Could not create backup: The shell command "mysqldump "--defaults-file"="C:\windows\TEMP\hoxexocbnxig.cnf" "--add-drop-table" "--comments" "--create-options" "--dump-date" "--no-autocommit" "--routines" "--default-character-set"="utf8" "--set-charset" "--triggers" "--no-tablespaces" "--single-transaction" "--column-statistics"="0" "--no-data" "--result-file"="C:\Websites\Sitename\storage\backups\iakoe--2024-06-03-123833--v4.9.5.sql" "sitename" && mysqldump "--defaults-file"="C:\windows\TEMP\hoxexocbnxig.cnf" "--add-drop-table" "--comments" "--create-options" "--dump-date" "--no-autocommit" "--routines" "--default-character-set"="utf8" "--set-charset" "--triggers" "--no-tablespaces" "--single-transaction" "--column-statistics"="0" "--no-create-info" "--ignore-table"="sitename.craft_assetindexdata" "--ignore-table"="sitename.craft_cache" "--ignore-table"="sitename.craft_imagetransformindex" "--ignore-table"="sitename.craft_resourcepaths" "--ignore-table"="sitename.craft_phpsessions" "--ignore-table"="sitename.craft_sessions" "sitename" >> 'C:\Websites\Sitename\storage\backups\iakoe--2024-06-03-123833--v4.9.5.sql'" failed with exit code 1. in C:\Websites\Sitename\vendor\craftcms\cms\src\controllers\UtilitiesController.php:226
Also running on windows, but just the default IIS & MySQL. I think this may be the issue:
"--defaults-file"="C:\windows\TEMP\hoxexocbnxig.cnf" I don't see that file existing.
When I remove that from the command and run it in a Command Window it backs up fine.
Thanks @mmc501! We were able to reproduce, and have fixed it for the next release.
You can test by changing your craftcms/cms
requirement in composer.json to 4.x-dev as 4.9.6
and running composer update
.
Thanks @brandonkelly, tried that and issue is resolved. Thanks
Thanks for confirming, @mmc501! Craft 4.9.7 and 5.1.9 are out now with that fix.
What happened?
I'm preparing to upgrade my project into
5.x
, however after I performed update to4.9.5
the backup always failed whether it was the one onmigrate/all
or when I randb/backup
commandI couldn't find anything interesting in the logs but another thing to take a note is I was able to do backup normally on
4.7.1
, let me know if I need to show somethingCraft CMS version
Craft Solo 4.9.5
PHP version
8.2.19
Operating system and version
WINNT 10.0
Webserver and version
Nginx 1.22.1
Database type and version
MySQL 8.0.32
Image driver and version
GD 8.2.19
Installed plugins and versions