Door clemens op ma, 2011/11/07 - 9:44am
Can you tell the field display weights of all your entities with one command? Or edit a node through the command-line?
drush --yaml entity-type-read node --fields=**/display/**/weight --include-fieldapi
drush entity-update node 12 --json
Watch the video on http://www.youtube.com/watch?v=cVGZzWjdDh8 and get convinced you want to know more of these entity internals.
Door clemens op vr, 2011/07/22 - 1:36pm
Sooo ... I've finally upgraded my own site. I thought it would be easy. A simple drupal site only using images. And yes I'm not reading READMEs that often. I trust drush somehow to handle this for me. But drush only sooth the 'pain'.
This blog contains my bash script which does some staging from production onto my laptop where I update the site to the latest D6 then upgrade to D7. The script is generic enough to adapt for other upgrades.
Door clemens op ma, 2011/05/23 - 12:20pm
Make sure you have your drush aliases file setup properly. Below a snippet from my b2b.aliases.drushrc.php
$aliases['dev'] = array(
'uri' => 'http://build2be.dev',
'root' => '/Users/clemens/Sites/build2be.dev/www/',
'path-aliases' => array(
'%dump-dir' => '/Users/clemens/Sites/build2be.dev/store',
'%files' => '/Users/clemens/Sites/build2be.dev/www/sites/build2be.dev/files',
),
);
Now we can run
drush rsync @b2b.prd @b2b.dev
Door clemens op di, 2011/02/15 - 11:46am
I just did an upgrade from the calendar and date module of which calendar needed to move from 6.x-2.x-dev to 6.x-2.4 version which seemed a pitb exercise. I hope I missed some skills :-p
The following command was not working
drush upc calendar-6.x-2.4
So what I did was download the latest version offsite. Then diff the module trees.
cd /tmp
drush dl calendar-6.x-2.4
cd /my-site/sites/all/modules/calendar
cp -r /tmp/calendar/* ./
Door clemens op do, 2011/01/13 - 11:06am
I want to run svn up on the site but I need to offline it first. So who is online?
SELECT name, mail, (unix_timestamp()-access)/3600 AS hours
FROM users
HAVING hours < 1
ORDER BY access;
Or for short
drush sql-query "select name, mail, (unix_timestamp()-access)/3600 as hours from users having hours < 1 order by access;"
Door clemens op vr, 2010/10/15 - 8:49am
For a site on my VM I needed an svn sync and the backup files on my developer site.
I initially didn't want to install backup_migrate module. This was partly due to my arcane workflow which is of course by hand and unfamiliarity with back_migrate module.
So this is what I deviced
test_site@serverVM:~$ crontab -l
# m h dom mon dow command
*/7 * * * * wget -O - -q -t 1 http://test-site.com/cron.php
*/5 * * * * /home/test_site/svn-up 2>&1 > /home/test_site/svn-up.log
* */1 * * * /home/test_site/ant-backup 2>&1 > /home/test_site/ant-backup.log
Door clemens op di, 2010/06/15 - 10:35am
We needed to protect our production site from prying eyes for a while with a basic authentication. Using apache basic auth settings seemed not enough. Or actually was too much. We wanted the theme to blend in. So these files were not supposed to get protected. Only our Drupal pages should.
The solution came from http://php.net/manual/en/features.http-auth.php. Adding the following to sites/default/settings.php makes the customer happy and drush too.
Door clemens op do, 2010/05/20 - 12:46pm
I want a clean database without clicking.
echo "\
SELECT concat('drop table ', table_name, ';') \
FROM information_schema.tables \
WHERE table_schema=schema()" \
| `drush sql-connect` \
| grep "^drop table " \
| `drush sql-connect`
This work only for single drupal / single schema installs.
Pagina's