2

I am trying to use Drush to backup a standard 7.12 local installation, but I am getting two error messages when running drush bam-backup:

The drush command 'bam-backup' could not be found.
Run `drush cache-clear drush` to clear the commandfile cache
if you have installed new extensions.

Could not find a Drupal settings.php file at ./sites/default/settings.php.

The bam module is enabled in my system.

Regarding the second issue, I have checked in the corresponding directory and it contains a default.settings.php file, but no settings.php file.

Is this a configuration issue, or a more fundamental bug? How can use Drush to backup my installation? Thanks.

P.S.:

I am on Windows 7 and I have used the Windows installer available here to install Drush. The bam version is 7.x-2.2 and Drush version is 5.0-dev.

5

Where is the settings.php file for your Drupal installation?

The problem Drush is having is that it cannot figure out where your settings.php file is. By default, Drush only looks in sites/default. There are a few ways that you can select the site you want if it is not in sites/default. One is to cd to the directory that contains the settings.php file, then run your command.

cd /path/to/drupal/sites/mysite
drush status

The other way is to specify the site you mean via the --uri parameter:

drush --root=/path/to/drupal --uri=mysite.com status

Once the status command works per the above advice, try calling bam-backup again.

3
  • I re-installed a standard local 7.12 system with bam only. I created a content type and a corresponding node instance. I went to the root of my site and called drush status -> It worked. I called drush bam-backup -> It failed. I searched the whole directory for a settings.php file -> There is no such file in my directory structure !?! Feb 16 '12 at 19:13
  • Ok, I think I know what the issue is. I am using Acquia Dev Desktop to import the installation and create a new database when installing Drupal. But it does not create a settings.php file itself. Yet, if this file is not available, drush cannot access login info to the database... So my bad here. Feb 16 '12 at 19:37
  • It can be the permission on settings.php file Feb 8 '16 at 16:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.