From 3dd9945fd64e9b1049dfe0fe7b87239c8465b0ab Mon Sep 17 00:00:00 2001 From: nachoparker Date: Thu, 10 Aug 2017 00:56:35 +0200 Subject: [PATCH] restore from other instance fix --- etc/nextcloudpi-config.d/nc-init.sh | 2 +- etc/nextcloudpi-config.d/nc-restore.sh | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/etc/nextcloudpi-config.d/nc-init.sh b/etc/nextcloudpi-config.d/nc-init.sh index b0107e0a6..77430b428 100644 --- a/etc/nextcloudpi-config.d/nc-init.sh +++ b/etc/nextcloudpi-config.d/nc-init.sh @@ -49,7 +49,7 @@ configure() # workaround to emulate DROP USER IF EXISTS ..;) local DBPASSWD=$( grep password /root/.my.cnf | cut -d= -f2 ) - mysql -u root -p$DBPASSWD <.*|'datadirectory' => '/var/www/nextcloud/data',|" "config/config.php" + sed -i "s|'datadirectory' =>.*|'datadirectory' => '/var/www/nextcloud/data',|" config/config.php sudo -u www-data php occ maintenance:mode --off sudo -u www-data php occ files:scan --all @@ -106,6 +106,9 @@ EOF fi rm -r "$TMPDIR" + # update NC database password to this instance + sed -i "s|'dbpassword' =>.*|'dbpassword' => '$DBPASSWD',|" config/config.php + # Just in case we moved the opcache dir sed -i "s|^opcache.file_cache=.*|opcache.file_cache=$BASEDIR/nextcloud/data/.opcache|" /etc/php/7.0/mods-available/opcache.ini }