So when I first realised that I was neglecting this blog, I somewhat found comfort in that at least it hadn't been a year, right? OK, so now it has almost been a year. Does that mean I have stopped finding solutions to my Drupal problems (as the "About me" block states)? Well, no. The biggest problem is remembering to blog about them, or finding the time. But finding the time is not a Drupal problem, and I most definitely have not found the solution to that problem. Anyway, I digress. Let's end the streak with a quick tip that I use all the time: Syncing live databases without having drush aliases.
If you use drush-aliases, you could just do drush sql-sync. But for me, even if I do, I still prefer this method, as I find it extremely easy to debug.
First I make sure I am in my Drupal root:
$ cd /path/to/drupal
Then I usually make sure I can bootstrap Drupal from drush:
$ drush st
If that output says my database is connected, then let's test the remote connection:
$ ssh firstname.lastname@example.org "drush --root=/path/in/remote/server st"
If that output also says we are connected, it means we are good to go, with my favourite command ever:
$ ssh email@example.com "drush --root=/path/in/remote/server sql-dump" | drush sql-cli
If you have a drush-alias for the site, you can also go:
drush @live-site-alias sql-dump | drush sql-cli