mandrasch / ddev-pull-wp-scripts

Inofficial DDEV pull scripts for happy local WordPress development.
https://ddev-pull-wp.mandrasch.eu/
Creative Commons Zero v1.0 Universal
18 stars 4 forks source link

Error during local clone #2

Open dyrer opened 1 year ago

dyrer commented 1 year ago

Obtaining database... Unzip wp-config.php from backup .zip-file to get DB_NAME-value ... Archive: backup.zip inflating: /var/www/html/.ddev/.downloads/db/wp-config.php
Unzipping .sql from backup .zip-file ... Archive: /var/www/html/backup.zip caution: filename not matched: .sql Pull failed: Failed to exec # set -x # You can enable bash debugging output by uncommenting set -eu -o pipefail pushd "/var/www/html/${DDEV_DOCROOT}" >/dev/null mkdir -p /var/www/html/.ddev/.downloads/db echo "Unzip wp-config.php from backup .zip-file to get DB_NAME-value ..." unzip -j "${backupfile}" "wp-config.php" -d /var/www/html/.ddev/.downloads/db pushd /var/www/html/.ddev/.downloads/db >/dev/null echo "Unzipping $(sed -n "s/define( 'DB_NAME', '([^'])'./\1/p" wp-config.php).sql from backup .zip-file ... "; unzip -j "/var/www/html/${DDEV_DOCROOT}${backupfile}" "$(sed -n "s/define( 'DB_NAME', '([^'])'./\1/p" wp-config.php).sql" -d . echo "Rename and gzip the .sql file to let DDEV handle the db import ..." mv "$(sed -n "s/define( 'DB_NAME', '([^'])'./\1/p" wp-config.php).sql" db.sql gzip -cvf /var/www/html/.ddev/.downloads/db/db.sql > /var/www/html/.ddev/.downloads/db.sql.gz on web: exit status 11

mandrasch commented 1 year ago

Hey there,

the pull script could not read out the setting for DB_NAME from wp-config.php file of backup.

My script currently only supports single quotes in wp-config.php:

define('DB_NAME', 'my-db-name');

(I documented this here as well: https://github.com/mandrasch/ddev-pull-wp-scripts#database-dump-doesnt-work---only-single-quotes-are-supported-in-wp-configphp )

Please change your wp-config.php to single quotes for all db values and try again.

Cheers, Matthias