Drupal tips, tricks, tutorials

How to restore a MySQL database and tables from .frm .ibd or .myd raw database files

powered-by-mysql-167x86.pngConsider a situation - you've got a well tuned MySQL database server running some popular websites. The sites are implemented with Drupal and Wordpress, but using MySQL to store the content and settings. You think everything is fine, until one day you look at Google Analytics and are aghast to see zero traffic for the previous two days. You go to the websites and are greeted by a 404 error, with the server saying there's nothing there.

If Wordpress is switching from PHP to Node.js, how should they do it?

wordpress-logo-stacked-rgb.pngnodejs-dark.pngSupposedly the Wordpress team is migrating Wordpress from PHP to Node.js. That astonishing bit of news comes from news.sys-con.com, but the evidence presented isn't exactly compelling.

Headless Wordpress/Drupal is galloping into view with Sleepy Hollow references tagging along for the ride

wordpress-logo-stacked-rgb.pngHeadless Wordpress is becoming a thing, now that Wordpress 4.4 has been released and has some core support for a REST API. The Drupal world has seen Headless Drupal work for a couple years now, and the Wordpress community has seen the light as well. The advantages of decoupling the website rendering from content management are many, the biggest perhaps being the rapidly changing best practices landscape for delivering content to the display device.

Drupal Book node hierarchy went missing, necessitating database patching and a couple scripts to help

Twice now I've had the Book hierarchy on a Drupal 6 site go bonkers. The first time was on this very site, back in 2009, while this site was being converted from Drupal 5 to Drupal 6 (it's now on Drupal 7). The /book page simply became empty, and I managed to fix the book hierarchy with some database twiddling. That was over six years ago and I'd since converted this site to Drupal 7. I have another site still running Drupal 6, and the same problem (empty /book page) just happened on that site.

The difference between Node.js require, and Wordpress plugins or Drupal modules

nodejs-dark.pngSomeone experienced with using Wordpress, or Drupal, to build websites are accustomed to "plugins" or "modules". Both are software modules which extend the functionality of Wordpress or Drupal websites, giving more features to the system than what's available out of the box.

Drupal & Blogger user tries Wordpress after years of sneering, and likes it

wordpress-logo-stacked-rgb.pngThe other night talking with my girlfriend about developing a website for her, we decided that she needed a Wordpress blog. She's done quite a lot with Blogger blogs and is very familiar with them, but the goals she had were impossible given Blogger's limitations. While Drupal is a very powerful system and could have done what she wanted, it's not exactly user friendly.

Installing xhprof and XHGui on a Dreamhost Ubuntu 12.04 VPS to diagnose Drupal 6 performance

One of my websites has been running very slow for years - every so often I try to figure out why it's slow, and recently it had been suggested to install xhprof to gather some data. The website is a Drupal 6 site that gets 1000+ visits a day, and is an active forum website with lots of people chatting away about electric vehicles. The server is a VPS rented from Dreamhost. The latest iteration of Dreamhost VPS's uses SSD disks, and a customized version of Ubuntu 12.04.

Fixing Drush when it says a "higher level bootstrap" is required, even though you're inside a Drupal website's working directory

I'm trying to get ready for a Drupal 8 port, and one of the steps is to get Drush set up. Nowadays that means setting up Composer and running some magic commands with Composer that supposedly sets up Drush. The problem then came when I cd'd into the root of my Drupal 6 site, and tried to run "drush pm-list --core" to generate a list of installed modules to prepare a readiness spreadsheet. The error message that came up gave me a big WTF feeling:

Fixing broken images when Drupal adds _0 to uploaded file names; filename and filepath differs

druplicon.large_.pngOccasionally on Drupal sites (perhaps only Drupal 6), uploading a file to a file field, or the file uploads area on a node, results in the "filepath" indicating a different name than the "filename". That is, in the data model for a Node, you can attach files in the "uploads" or in a CCK field (in Drupal 7 this is slightly different) and each attached file is an object (or array) containing attributes named "filename" and "filepath".

Eliminating duplicates in Views 3 Drupal 6 when the "distinct" and "group by" features don't work

Yes, Drupal 6 is water under the stream except for those of us still maintaining Drupal 6 websites. On one of my sites I'm trying to bring the module status into 2014, because they'd last been updated in 2012 and Views hadn't even been upgraded to Views 3. It was pretty straightforward to generate a Drush Make file to generate updated code for the site. A couple of the Views didn't get properly upgraded to Views 3, and in most cases minor tweaks were all that was needed. But one View had a major flaw - it generated lots of duplicated content.

Pages