How can I send Drush commands to Pantheon - drupal

I am trying to migrate my drupal 7 siteto drupal 8 site that resides on pantheon. For this purpose I have installed 3 migration modules as described in the docs. I have added my drush aliases in drush directory and I can see all my sites available:
I am using this drush commands to migrate my data to drupal 8 site on pantheon:
drush #pantheon.syyamtwo.dev drush migrate-upgrade --configure-only
But when I execute this I get the following error:
My drush version is: 8.3.1

I prefer using terminus, terminus drush [site-name.site-env] -- drush_command. Where site-name and site-env are your pantheon values.
Here is what that looks like for migration-tools drush commmands on a site name "foo" with an environment "bar":
terminus drush foo.bar -- ms
terminus drush foo.bar -- mim --tag=terms
Notice the use of --, this allows you to pass options to the drush command.

Related

Updating Drupal Core Using Drush Says It Updated Successfully But Does Not?

I am trying to update a clients Drupal site using Drush from 7.64 to 7.67. I go into my project folder using puTTy and run these commands:
drush vset --exact maintenance_mode 1
drush cache-clear all
drush pm-update drupal
drush vset --exact maintenance_mode 0
drush cache-clear all
When a run the update command I get the following message:
Project drupal was updated successfully. Installed version is now 7.67.
But after, when I go to my websites admin section and check the updates section it still says Drupal core is on 7.64 and not on 7.67.
I ran the above commands a few times to see if it was just a coincidence, but it still would not update Drupal core.
I think you missed the updb command in your steps. Here's my revised version of your steps with it included.
drush vset --exact maintenance_mode 1
drush cache-clear all
drush pm-update drupal
drush updb -y
drush vset --exact maintenance_mode 0
drush cache-clear all

Drush was not able to start the Drupal database

When I start drush en name_of_module in terminal i get this error
Im using mamp and 5.3.27 php version
Drush was not able to start (bootstrap) the Drupal database. [error]
Hint: This may occur when Drush is trying to:
* bootstrap a site that has not been installed or does not have a
configured database. In this case you can select another site with a
working database setup by specifying the URI to use with the --uri
parameter on the command line. See drush topic docs-aliases for
details.
* connect the database through a socket. The socket file may be
wrong or the php-cli may have no access to it in a jailed shell. See
http://drupal.org/node/1428638 for details.
Drush was attempting to connect to:
Drupal version : 7.34
Site URI : http://default
Database driver : mysql
Database username : root
Database name : ceo
Default theme : garland
Administration theme : garland
PHP executable : /usr/bin/php
PHP configuration :
PHP OS : Darwin
Drush version : 6.5.0
Drush configuration :
Drush alias files :
Drupal root : /Users/edinpuzic/Desktop/Projekti/CEO/cm
s
Site path : sites/default
File directory path : sites/default/files
I just copied the answer to another/similar question I answered recently. drush says in your snippet above, that it asumes the site URI http://default. I'm sure that's not correct? Drush needs some context to know where to get your installation (install folder and database). It knows the installation root, but not the URL (to select the correct sites/folder/).
You might want to use the option --rootto specify the webroot of your drupal installation. You can also specify the website URL using the option --uri, if you have a multisite installation. Look at http://docs.drush.org/en/master/usage/#options for an in-depth description.
But the best way to handle you setup is drush aliases (http://docs.drush.org/en/master/usage/#site-aliases). You define an alias #site1 etc. and this alias references the webroot and site URL (and optionally other parameters as well).

Module installation using drush giving error

I have downloaded drush and cofigured it properly .Now I am trying to download a module "themekey" and install it to my drupal .Its downloading properly using
drush dl themekey
but when I try to install it using
drush en -y themekey
I get this error
drush en -y themekey
Command pm-enable needs a higher bootstrap level to run - you will [error]
need to invoke drush from a more functional Drupal environment to run
this command.
The drush command 'en themekey' could not be executed. [error]
A Drupal installation directory could not be found
Please help me in this , I am new in drpal drush and did not find way to solve this
Here is my drupal folder
/opt/lampp/htdocs/projects/drupal_test/
You need a working drupal installation, meaning php can be executed the mysql server can be reached. Then you have to change into the root directory of your installation - in your case:
cd /opt/lampp/htdocs/projects/drupal_test/
and execute the command:
drush en modulename -y
For debugging use
drush rq
If you tried changing localhost to 127.0.0.1 in settings and it still doesn't work, please have a look at the solution I found here:
Drush: “Command pm-enable needs a higher bootstrap level to run
When running drush you can run into this error message. In my case, the mysql command line tool provided with Mamp Pro was not available. You can easily test this by typing the command ‘mysql’ in terminal. Your output might be -bash: mysql: command not found.
To solve this, do the following in terminal:
sudo vim ~/.bash_profile
Press i
Move to the last line and append
export PATH=/Applications/MAMP/Library/bin/:$PATH
Hit escape
Type in :wq (including the colon) to write the file and quit vim.
Reload your profile by running source ~/.bash_profile.
The mysql command AND drush should now work!

Drush. Command pm-enable needs a higher bootstrap level to run

I have started to learn Drupal on this week and I have installed the drush on my virtual machine with CenOS ( Drupal version: 7.28, Drush version: 7.0-dev). I installed drupal using drush by command: drush dl --drupal-project-rename=mysite
and downloaded some moduls by command: drush dl admin_menu ctools views ...
But when I want enable these moduls in Drupal by command: drush en -y admin_menu_toolbar ...
I have errors:
Command pm-enable needs a higher bootstrap level to run - you will need to invoke drush from a more functional Drupal environment to[error]
run this command.
The drush command 'en admin_menu' could not be executed. [error]
Drush was not able to start (bootstrap) the Drupal database. [error]
I changed the code in the file /sites/default/settings.php
'host' => 'localhost', to
'host' => php_sapi_name() == 'cli' ? '127.0.0.1' : 'localhost',
but it still does not work.
Tell me please how can I fix it?
If I use command "drush si standard --db-url=mysql://user:password#localhost/db_name" database is create and drupal install. But when I try to sign in using provided username and password server answer me "404 Not found".
Pictures:
http://gyazo.com/c34c2f361d1675d6df42b909d7eded09
http://gyazo.com/a118b2e370b79103046f21e50f955b2f
Just running drush dl --drupal-project-rename=mysite will not install drupal for you. Only download the source.
Running drush si standard --db-url=mysql://user:password#localhost/db_name will install it for you.
Alternatively you can add --account-pass=somepassword to set the user 1 pass directly when installing.
Remember to change the --db-url to suit your setup.
After that is done, be sure you stand in the project when you run drush commands.
In my case it turned out that I needed to install mysql-client:
apt-get install mysql-client
I had the following situation:
drush 4, 5 and 6 worked fine for me.
drush 7+ didn't work (different errors, including that ones you're describing).
And my MySQL database was located on a separate server.
HTH,
Alexander

omega 4.x sub theme creation

I have spent lots of time to search good tutorial or documentation for creation omega 4.x sub theme, But did't found. Like How to create a layout templates using with node types, taxonomy, user pages. Any help appreciable
If you are a windows user, you will first need to set up a virtual box with linux. While linux is the preferred choice to theme with Omega 4, you can also use mac but will need homebrew, etc.
Windows user:
Virtualbox https://www.virtualbox.org/wiki/Downloads
Drupalpro https://drupal.org/project/drupalpro
Drupalpro is a prebuilt linux environment for drupal. Follow the directions for install then complete the drupalpro update that is documented in the middle of the page. Make sure and update drush as per the update directions as Omega 4 needs more recent version. Last, update ubuntu with sudo apt-get update (don't use the package manager)
The directions below have been tested with Drupalpro (source for rvm install)
Install https://rvm.io/ Always check for the most recent/stable version!
$ \curl -L https://get.rvm.io | bash -s stable
$ source /home/drupalpro/.rvm/scripts/rvm
$ rvm requirements
Next build and install the latest version of Ruby (this might take awhile). As of Aug 2013, this is the latest build. Please change as needed.
$ rvm install 1.9.3
$ rvm use 1.9.3
$ rvm rubygems latest
Verify rvm install:
$ rvm -h
$ rvm list
$ ruby -v
You should get a message similar to: ruby 1.9.3p448 (2013-06-27 revision 41675) [i686-linux]
Now you are set up and ready to install an Omega4 subtheme. Cd to the root of your drupal site.
drush dl omega --select
Choose the appropriate Omega4 version. This will automatically download and place Omega 4.x in sites/all/themes/omega. Omega4 comes with it's own drush commands which is why it is important to have a recent version of drush. Clear drush cache then view the new omega drush commands.
drush cc drush
drush help --filter=omega
Create your subtheme
drush omega-wizard
Follow the set-up directions.
Please enter the name of the new sub-theme [Omega Subtheme]: Yoursubthemename
Please enter a machine-readable name for your new theme [yoursubthememachinename]
Please choose a base theme for your new theme
2 : Omega - A powerful HTML5 base theme framework utilizing tools like
Sass, Compass, Grunt, Bower, Ruby Version Manager, Bundler and more.
Please choose a starterkit for your new theme
1 : Default: Comes with a well organized Sass setup with heavy use of
partials. (Provided by Omega)
Please choose a destination. This is where your sub-theme will be placed
Please choose a destination type.
1 : Site (e.g. 'all' or 'example.com')
Please choose a site.
1 : all
Do you want to keep the starterkit's readme files? (y/n):
Do you want to enable your new theme? (y/n):
Do you want to make your new theme the default theme? (y/n):
If everything went as it should you will see the following message:
You have successfully created the theme Yourthemename (yourthememachinename) in sites/all/themes. [success]
After finished, inside your subtheme run:
bundle install
trouble shooting If you receive an error at bundle install or at bundle exec guard, you may need to change your terminal preferences. terminal > profile preferences > title and command > check-mark "run command as login shell" image. Close terminal, cd back to the root of your site and run bundle install.
cd into root of sub-theme:
bundle exec guard
You have now created your Omega Subtheme. Documentation for creating custom layouts here
leveluptuts are making great tuts right now for omega 4.x
leveluptuts.com
here is the playlist at Youtube : http://www.youtube.com/playlist?list=PLLnpHn493BHH5nnK2dKE_42l1oXA6Tq6H with something like a new video per week !

Resources