Heartening News For Spain

This is great news for us and the world!

http://www.telegraph.co.uk/finance/comment/ambroseevans_pritchard/10755598/Global-solar-dominance-in-sight-as-science-trumps-fossil-fuels.html?utm_source=facebook&utm_medium=oped&utm_term=Mon%2C%2B21%2BApr%2B2014%2B09%3A57%3A22%2BGMT&utm_content=solar&utm_campaign=Climate&txtArea

Building A Droplet LAMP Server

First lesson learned about Digital Ocean; for temporary Droplets using public / private key authentication in SSH for ‘root’ login is not worth it! In fact its a real PITA! But as turning off root access by SSH is strongly recommended there’s really no point anyway. Better to do steps 2 to 7 as a matter of routine.

Once I know that I will keep a Droplet longer term then I will set up an RSA key to authenticate to it using my ‘normal’ account, at least from Braeburn, using the method of configuring public / private key authentication here by running the command ssh-copy-id {remote_host} to install the local machine public key on the remote server.

My build method basically follows this page and this page.

  1. Select the lowest configuration option, nearest available datacentre (London or Amsterdam) and Debian 7.0 x32 as the O/S giving it an appropriate hostname. The root password is emailed, which for a temporary Droplet is fine.
  2. Log in using SSH and use passwd to immediately change the root password to the usual long Rob Roy
  3. Add garrathe as a normal user by running adduser
  4. Configure garrathe as a sudo capable user following the above build page and running visudo and adding the line:

    garrathe ALL=(ALL:ALL) ALL

    in the section

    # User privilege specification
    root ALL=(ALL:ALL) ALL
  5. Log out the root account and log in as me
  6. To make the server more secure open the configuration file

    sudo nano /etc/ssh/sshd_config

    Find the following sections and change the information where applicable:

    Port yyyymmdd
    (use a memorable date e.g. birthday or wedding anniversary)
    Protocol 2
    PermitRootLogin no
    (changing this from yes to no prevents future root login)

    Add these lines to the bottom of the document. AllowUsers will limit login to only the users on that line.

    UseDNS no
    (at this time I’m not sure what this line does?)
    AllowUsers garrathe

  7. Patch using sudo apt-get update to freshen the database of ‘stuff’ followed by an sudo apt-get upgrade to get things patched up to date.
  8. Confirm the name of the packages using apt-cache search {package name}.
  9. Install the AMP using sudo apt-get install apache2 mysql-server php-pear php5-mysql php5 libapache2-mod-php5.
    Info: The last one might be installed by one of the preceding ones and so may be redundante, update when sure.
  10. Confirm that Apache is working by http://{IP address}.
  11. Enter mysql -p in the shell to confirm MySQL is working.
  12. To check whether php is installed and running properly, use sudo nano /var/www/test.php to create a test.php in the /var/www folder with the phpinfo() function exactly as shown:

    # test.php


    Point a browser to http://ip.address/test.php and this should show all your php configuration and default settings.
  13. Optional: To install phpMyAdmin just execute sudo apt-get install phpmyadmin.

Building A Local LAMP Server

This is based on a local VMWare Guest starting with Debian 7.4 (i386) because the server has less than 2GB RAM. Its actually 512MB RAM and 20GB disk, so that it matches the lowest Digital Ocean Droplet configuration. The reason I’m doing this is because I want to move away from CentOS onto Debian longer term.

  1. Download the internet installer as its only about 240MB and boot a new VM from that. Use the text installer UI to install.
  2. Add install options of Web and SQL to the offered list.
  3. Install VMware Tools, but this requires the installation of GCC using apt-get install build-essential.
  4. {Next step is to test Apache and MySQL then update the snapshot}

Image Assist Repair Script

This post will contain a copy of the T-SQL script that I use(d) to ‘upgrade’ the D7 database to show the images that were placed in the D6 database nodes using the retired Contributed Module Image Assist.

Copying Tables Between Databases

To copy tables between database (on the same server) use this syntax:

CREATE TABLE New Table_name
SELECT * FROM Original Table_name;

So my code snippet is:

CREATE TABLE `xfer_db.image`
SELECT * FROM `cnueu_drpldb.image`;
CREATE TABLE `xfer_db.files`
SELECT * FROM `cnueu_drpldb.files`;

Note to self: try always to create snippets that can be run in phpMyAdmin or in the mysql command shell. Hence one reason to use back ticks to enclose field names in MySQL as shown.

The Image Assist Solution

The high level process ought to be this.

  1. Take a backup of the production database cnueu_drpldb to a .sql file named cnueu_drpldb6.sql to explicitly identify the Drupal version.
  2. Restore this to a non-production MySQL server so that the restored database name matches the restored dump file.
  3. Create an ‘export’ database called xfer_db. Extract what the needed from the D6 database by copying the images, files and node_revisions tables from the restored backup of the production database.
  4. Identify the page nodes that have images embedded in them from the Node Revisions table by the presence of the Image Assiste modules HTML string starting [Image_assist and extract the image node IDs from which the Image Assist module embeds the image in the posted node using the image NID value in the string in the node_revisions table. Write the page NID and image NID to the transfer database.
  5. Use the image NID to identify its FID (file ID) in the Files table.
  6. Enumerate the two tables and write the node ID, the file ID, the filepath and other metadata into a new custom table.
  7. Upgrade the D6 non-production website to D7 using my ‘discovered’ upgrade process.
  8. Use that new table to write the file path into the correct node record of a copy of the migrated databse within CSS to place the picture at top right of the poem area in an upgraded D7 version of the website on the non-production webesite.

Sounds simple, but I suspect the development of the necessary T-SQL script will be far from such. I have started a T-SQL techno-blog to capture this and other ‘snippets’, and store tips and reminders too. I will build this ‘Image Repair’ script in a posting in this techno-blog.

Moving Databases

phpMyAdmin includes import and export facilities but the size of the file is limited by a number of differing locations across the system. Its a real PITA to remember, find and change them all each time I run up a new system on a VM.

So I have opted not to use them, but instead to use command line options where possible. (The one exception is our current hosting service UK2, which doesn’t give SSH access to non-business users.) So I have book marked this location that shows how to do it in the mysql command line (inside a shell).

http://stackoverflow.com/questions/859313/import-sql-dump-into-mysql

Then this one shows how to use mysqldump from the shell command line

http://stackoverflow.com/questions/8444108/how-to-use-mysql-dump

The nice thing about both of these is ‘>’ dumps out to a file and ‘<' imports from an existing dump file. Where there is no access to a terminal shell, e.g. with SSH then this is possible in the SQL window of phpMyAdmin as well as within a mysql command shell:
use db_name;
source backup-file.sql;

See http://stackoverflow.com/questions/17666249/how-to-import-a-sql-file-using-the-command-line-in-mysql

It also occurs to me that this last is also the way to run any script from a command line or within phpMyAdmin.

How To Change Hostname

The command to view the hostname in a terminal is simple; just typing hostname and hitting return will show you what the hostname for the system is.

The way to change the hostname is not obvious. There is a configuration file in a folder called /etc/sysconfig called network. By default it contains:

NETWORKING=yes
HOSTNAME=hostname

where hostname is the name you chose while running the original installer, just change the name using nano and save. The change appears to be effected immediately.

Remember: you need to be root to do this.

The Harvey Saga!

The Harvey saga continues. We deferred collecting from last weekend to this one. So before driving up the valley to Autotech I gave them a ring to confirm it was ready. The answer was a very unhappy “no”. John seemed very embarrassed to have to admit that when “the lad” moved Harvey he had put it into Park before Harvey had stopped moving. I knew what was coming next. The transmission locking pin had snapped off! Argh!

A replacement part has been ordered from Chevrolet in the US at a cost (to Autotech) of £90. And I guess the cost of labour to remove the gearbox again?

We went up anyway and made a snagging list, of the ladder repair still to do, the locker door repair still to do and fit a locking fuel cap. While looking around the alarm kept going off and the tracking company rang us to alert us that there had been an alarm event.

We will collect it next week, subject to the locking pin arriving and getting fitted.

Eating Humble Pie!

Following on from my last post I have had to eat a lot of humble pie with the FitBit team. The reason? This solution actually works!

It shouldn’t but it does! At least in the short term. I’ll post on this again in a week or so’s time and maybe a month if I remember.

Totally P*ssed Off With FitBit Support!

On Wednesday I had to remove the App and do a factory reset on my iPhone 4S to get Bluetooth and WiFi working. They both were completely disabled when I used the App to sync to my phone. I raised a ticket with support and so far I’ve had two responses which did not address my problem, were clearly boilerplate scripted responses and were basically “please try xyz” when I had stated that I had done these things already. It’s like there isn’t a person reading the ticket at all! It’s now Saturday and I still do not dare to reinstall the App onto my iPhone.

I’m posting this everywhere I can think of to try to get some meaningful help!

The Image Assist Dilemma

So the next thing to do is to develop an automated process for replacing the images in those nodes where Image Assist had been used to insert them in D6. I think the process is:

  1. Find the nodes that have images inserted by Image Assist in D6.
    To find the nodes with images inserted using ImageAssiste use:
    SELECT * FROM `node_revisions` WHERE `body` LIKE '[img_assist%'
    where the LIKE operator looks for a pattern in the field. In this instance the string starting with [img_assist where the % is a wildcard so that all are found. A test of the query returns 715 rows, which is rising as we add more posts to the online live site.
  2. Determine the Node ID for the Image Node the image is located in. The Node ID is the next part of the Image Assist string in the Body of the Poem (or other) node.
  3. Determine the file path of the image file. The Image table has three columns, the first two are the Node ID (i.e. the Node that contains the image not the node that the image is embedded in) and the File ID. So using SELECT * FROM `image` WHERE `nid`=1389 returns:

    nid fid image_size
    1389 2608 preview
    1389 2595 _original
    1389 2607 thumbnail

    And looking in the Files table using SELECT * FROM `files` WHERE `fid`=2595 returns the line with the filepath filed containing the path to the original image file on disk.
  4. Insert the image file into the Poem node so that it floats to the right with padding like Image Assist used to do

There is then the issue that the text layout of the poems themselves has been lost too!

Another Gotcha! Permissions and a SQL Solution

I’ve just realised that there is a consequence to the loss of Author (where blank = Anonymous) in the online D6 site when it is upgraded. Anonymous users can at the least change the outline configuration. I need to ‘craft’ some SQL code to ‘inject a user’ into the blank fields in the database.

So looked in W3Schools and will try this on the live database.

UPDATE node_revisions
SET uid=175
WHERE uid=0;

This has set the uid field to 175 when it is 0, which is the anonymous uid and 175 is the uid of a new user account I have set up for this exercise. But that didn’t work, so tried it again using:

UPDATE node
SET uid=175
WHERE uid=0;

And now if the node / revision isn’t set to me or Lynne it is now set to C-N-U, which means that it isn’t Anonymous and therefore editable by anonymous users after the upgrade.

Today Is Not A Good a Day To…

Today is not a good day. And I guess this post will be a personal litmus test of just who actually looks at this site that I toil over?

Just over twenty five years ago Sarcoidosis killed about 10% of my lungs! Then for no known reason it stopped, when it could have so easily gone onwards and killed all of me!

Fifteen months ago I was operated on because I was diagnosed with Colon Cancer. So far the outcome has been an all clear, but that is no guarantee of my longer term survival.

Today, after a short series of blood tests by my GP I get a letter of appointment from the BRI that I have a referral to their Diabetic Clinic!

All I want is a happy retirement. Is it too much to ask?

Homemade Mustard

This is a recipe from James Martin on Saturday Kitchen. According to Mr. Martin the effort is well worth the better flavour.

Ingredients

  • 50g/2oz white mustard seeds
  • 50g/2oz black mustard seeds
  • 75g/3oz soft light brown sugar
  • 2 tsp ground allspice
  • pinch ground cinnamon
  • 1 tsp coarse salt
  • 1 tsp black peppercorns
  • 1 tsp paprika
  • ½ tsp turmeric
  • 125ml/4fl oz red wine vinegar
  • 3 tbsp stout

Preparation method

  1. Place all of the dry ingredients into a food processor and blend until the seeds are roughly crushed.
  2. With the motor still running, gradually add the vinegar and blend until well mixed.
  3. Add the stout and blend briefly.
  4. Transfer the mustard to a bowl and leave to stand for one hour to thicken, then transfer to sterilised dry jars.
  5. Cover the surface of each with a disc of waxed paper, waxed side down, and leave until cold.
  6. Top the cold jars with airtight lids, label and store in a cool dark place. The mustard should keep for 3-6 months.

GF Rice Pudding Cake

Andy Bates’ Recipe at http://www.foodnetwork.co.uk/recipes/rice-pudding-cake-rum-and-raisin-apples.html

Ingredients

350ml whole milk
350ml double cream
1 vanilla pod, split and seeds scraped
Zest of 2 lemons, peeled into wide strips with a potato peeler
50g light brown soft sugar
100g Arborio risotto rice
Pinch salt
Knob unsalted butter
250g dulce de leche
3 dessert apples (Pink Lady or Cox)
50g caster sugar
½ teaspoon ground cinnamon
25g unsalted butter
50g sultanas
50ml spiced dark rum

Method

Preheat the oven to 180 degrees Celsius or 350 degrees Fahrenheit. Pour all of the ingredients, except the eggs and dulce de leche, into a saucepan and bring to the boil.

Reduce the heat and simmer for 15 minutes, stirring constantly, until thickened. Take the pan off the heat and remove the vanilla pod and strips of lemon zest.

Leave to cool for 10 minutes, remove the vanilla pod and lemon zest then beat in the eggs. Meanwhile grease a 20 centimetre sandwich tin with the butter, spread the dulce de leche over the base in an even layer then chill in the fridge until needed.

Pour the cooled rice mixture over the top and even out the top with the back of a spoon.

Place on a baking tray and bake for 25 to 30 minutes until just set, with a slight wobble in the centre. Leave the cake to cool completely then transfer to the fridge and chill until ready to serve.

Just before serving, prepare the apples. Core the apples, cut into wedges and toss with the sugar and cinnamon. Heat the butter in a non-stick frying pan and when foaming add the apples.

Cook for 2 to 3 minutes, shaking the pan occasionally, until then apples are golden brown but still hold their shape. Add the raisins and rum and cook until most of the liquid has evaporated.

Remove from the heat and leave to cool slightly. Turn the rice pudding cake out onto a serving plate or board. Cut into thick slices and serve with the warm apples.

Mumbai Pav Bhaji

Pav Bhaji – Popular Street food of Mumbai
Author: Dassana
Recipe type: Mumbai Street food
URL: http://www.vegrecipesofindia.com/pav-bhaji-recipe-mumbai-pav-bhaji-a-fastfood-recipe-from-mumbai/
Cuisine: Indian
Serves: 5-6 plates of pav bhaji

Ingredients
2 medium size potatoes
1 cup chopped cauliflower
1 cup chopped carrot
1 cup peas, fresh or frozen
½ (half) cup chopped french beans (optional)
1 large onion – finely chopped
2 to 3 large tomatoes – finely chopped
1 capsicum/green bell pepper
2 to 3 tsp ginger-garlic paste
1 or 2 green chilies, chopped
1 or 2 tbsp pav bhaji masala
½ tsp garam masala powder (optional)
1 tsp chilly powder or freshly pounded 1-2 dry deseeded red chilies – the latter works much better and imparts a beautiful orange color to the bhaji
1 tsp turmeric powder
1 tsp cumin seeds
amul butter as much you want
salt
12 pavs

Instructions
Preparing the Bhaji:
Boil all the vegetables except onions, tomatoes and capsicum in a pressure cooker or microwave oven.
Mash the vegetables and keep aside.
Just lightly mash. Don’t make a puree.
In a pan, add butter.
When the butter melts, add cumin seeds. When they sizzle, add the chopped onions.
Fry the onions till they become transparent. Now add the ginger-garlic paste.
Fry till the raw smell of the ginger-garlic paste disappears.
Add chopped green chilies and fry for a minute.
Add the tomatoes and fry them till they become soft and mushy.
Add the chopped capsicum. Now add the chilly powder, turmeric powder and pav bhaji masala.
Mix the dry masalas well. Fry for few minutes till the capsicum become a little soft.
You don’t need to make the capsicum very soft. A little crunch is alright.
Now add the mashed vegetables.
Combine the mashed vegetables well with the masala.
Add some water. Keep on stirring and let the vegetable simmer for 7-8 minutes.
If the vegetable becomes too dry and then add some more water.
When done, garnish with coriander leaves. Serve with chopped onions and chopped lime.
While serving, add amul butter to the bhaji and serve with buttered pavs.
You can add more butter, if you like it. In fact, with more butter, the pav bhaji tastes very good.

Node Gallery Investigation

This seems to integrate galleries and inline insert but is not intuitive or straightforward and is going to need much investigation and experimentation to understand and document.

And a weekend later I am not much the wiser! And there is a severe lack of documentation on this as an option.

And then somehow I’ve cracked it. Unfortunately no clear idea how. Something to do with node gallery content types?

What is clear is that placing images inline and creating galleries are two separate workflows. Both seem simple enough. I just need to crack floating images to the right of text for Lynne to place them in poems and recipes.

Gallery Options

Now I need a gallery solution and the options at first cast are Media Gallery and Node Gallery.

As I have Media already installed investigate that first but download Node Gallery anyway. When I go to activate Media it reminds me it needs Ctools (Chaos Tools) installing to be able to activate it. Ctools has lots of options so start simple and only activate Ctools and Media itself, which tells me I must activate its File Entity option too. Again there is lots more to investigate.

Media Gallery appears to be mutually exclusive with the Insert Module. If I choose the File upload widget to be Media browser I lose the Insert button, if I choose the File widget I cannot browse the Media Gallery. I will devote a bit more time seeing if they will integrate before disabling and trying Node Gallery. And decide to disable for now.

Activating Node Gallery shows me that I need two more modules Entity and Entityreference. So download those as well.

Colorbox Configuration

Colorbox is a one-shot applies everywhere configuration type module. So far the default Colorbox style is the one I like but I will need to consult. One change to,default configuration is to enable the inline option so the tapping inline images displays the image in color box.

This one will need more experimentation to find any nuances.

Finally! Cracked Insert

Finally, last night, the Insert penny dropped! To get images inline two conditions need to be met:

  1. the Content Type must have a File Upload field included at Home > Structure > Content types > Travel > Manage fields. The example here is the Travel Content type where the label is Add Image.
  2. At the bottom of the Travel settings is (contracted) the Insert control. Expand it and tick the Enable insert button box.

Then a couple of hours of fiddling determined how to hide the Add Image file attachment when viewing. How to pick an image style for the insertion. Now I think I need to learn how to configure styles so that a thumbnail is positioned as desired and is enlarged in Colorbox when tapped.

WYSIWYG Editor Solution Solved

So the new theory is:

  • Install the WYSIWYG module first
  • and the Insert module
  • and then, as WYSIWYG says, the CKEditor libraries package, not “the CKEditor for Drupal module”

First two are straightforward, download, unzip and activate. Then make a new folder sites/all/libraries/ckeditor. And get an error message which I google, to find that the latest stable version of CKEditor is not yet supported by the latest of WYSIWYG!

So ‘downgrade’ to v3.x and now the editor can be configured at admin/config/content/wysiwyg. So we have a content authoring solution but still no simple way of adding images inline as yet, nor of viewing them within the web site.

CKEditor for Drupal Module Not The Solution

Found this article at Cocomore.Com which claims to solve the problem so try that.

After reading this through the article is very useful using IMCE and Lightbox2 as the examples. But in a reply to a comment the author also says that Colorbox is an alternative and that he may well end up preferring Insert. But perhaps more importantly I find in the Wysiwyg configuration page this warning.

CKEditor (Download) Not installed.
Extract the archive and copy its contents into a new folder in the following location:
sites/all/libraries/ckeditor

So the actual library can be found at:
sites/all/libraries/ckeditor/ckeditor.js

Do NOT download the “CKEditor for Drupal” edition.

So now I’m thinking I can uninstall IMCE and CKEditor modules and install the CKEditor library? Need to test tomorrow.

Set Up Zen & C-N-U Theme Procedure

  • Step 16 continued: now would be a good time to turn my attention to the theme, which should be straightforward. Delete the C-N-U theme, upgrade the Zen theme and create a new C-N-U theme for D7 by copying the STARTERKIT folder up to the Themes level at sites/all/themes. It’s very simple to install following the README.txt file, especially as I’ve saved the normalize.css file from the sites/all/themes/cnu/css folder and the responsive.css file from the sites/all/themes/cnu/css/layouts folder.

    So having sorted the C-N-U theme its back to Modules and the image, galleries and inline insertion thereof conundrum. Install Media and Insert modules. The latter at the recommendation of the Drupal Core Image documentation as the solution to inserting images inline. WYSIWYG wants an URL that I currently don’t have as the images don’t seem to be associated with any nodes (and of course there are nodes that now do not have their images!) I’m really starting to miss the D6 Image module and all its bits like ImageAssist!

    Start to explore the Media and Insert modules and find that Media module has the command Rebuild type information for media, so run that but not sure what the success message “All files in the system have been assigned types. Media installation complete.” really means? Can I see the uploaded images now? So next look at Media browser settings to see what clues lie there? Answer, not a lot – still bamboozled!

Complete CCK Fields Migration & Start on Modules Installation

  • Step 15 continued: so install the References module and see if that permits more fields to be migrated from CCL to Core. But that does not add any migrate-able fields to the Structure | Migrate fields page.
  • Step 16 is to upgrade the modules that were not uninstalled and upgrade the theme.

    Start with ACL, Book Access and Forum Access. Forum Access requires Chain Menu Access. Then move on to Views which requires Chaos Tools (aka Ctools).

    ThickBox has been retired and the recommended ‘upgrade’ is Colorbox which is composed of a module and an additional plugin. Also learn it needs the Libraries module from reading the installation instructions in the README.txt file. This doesn’t appear to be working just now and could be a lot to learn, so move on for the sake of getting this whole shebang finished. Then I find I need to install the Colorbox Plugin, so give that a whirl, which involves creating a new folder sites/all/libraries.

    So this brings this upgrade test to the point of identifying a replacement for the D6 Image module. First candidate is CKeditor for WYSIWYG content editing to make bullet and numbered lists, bold and italic much more user friendly. Upload it and run update.php to install it. It took a while to suss show to associate a CKeditor profile with a text format like Filtered HTML but once understood it looks good.

Complete Core Repeat Upgrade

  • Step 7 is to remove default.settings.php in the folder /var/www/sites/default
  • Step 8 is to remove all the core files and folders except the sites folder from /var/www
  • Step 9 is to remove all files from the sites/all/modules folder, which I did earlier
  • Step 10 is to download to a folder outside the web server and install the latest version of Drupal core, which at the time of writing is 7.26 and extract.
  • Step 11 is to re-apply modifications to core files, which does not apply here as I consider it good practice to avoid it where possible, and have done so in so far
  • Step 12 is to make the settings.php file writeable
  • Step 13 is to run update.php on the upgraded installation and get an error that the settings.php file is not writeable. I keep on having to set permissions for everyone not just the pi user (or group), which seems to indicate that apache is not running under the pi user on Raspberry Pi? This is quite slow on the RPi but completes…Successfully with a page of messages – see attached PDF file. But Garland appears broken so switch to Bartik which does work.
  • Step 14 is to take a backup immediately of the upgraded database before attempting anything further. Do this using MYSQLDUMP utility in the shell rather than phpMyAdmin to keep the file on the RPi server.
  • Step 15 is to upgrade the fields, i.e. move stuff out of CCL into the replacements in Core. The first thing to do is to replace the CCL in the sites/all/modulesfolder and run update.php. Looked at the new install facility but it needs FTP access to the server to work, and that is just plain difficult. So do it the manual way in the terminal shell. then I can go to Structure | Migrate field and there is one field available for migration. As D6 included User References and Node References (dunno why) I guess I also need the References module?

Repair Database Then Start To Repeat Upgrade Test

As I know the script will ‘repair’ the database after replacing D6 core with D7 core its worth a wee bit of time to try it before.

So in the MYSQL shell run source DB_repair.sql and see what happens? And nothing seems to have broken! Despite one small error message at the end ERROR 1017 (HY000): Can’t find file: ‘./cnueu_drpldb/d6_date_formats.frm’ (errno: 2).

So next is to repeat the Upgrade process from the web site page https://drupal.org/node/570162.

  • Starting with steps 1 through 5 to get into a ‘clean’ state so to speak
  • Step 6 is disable all non-core modules, and if they are not going to be used in D7 to uninstall them from that tab on the page, like if they are deprecated/retired/discontinued, i.e. Image and associated modules. The list for confirmation of uninstalling is:
    • Advanced Help
    • Image
    • ImageAPI
    • ImageCache
    • ImageField
    • Image Attach
    • Image Gallery
    • Image Import
    • Image assist
    • Thickbox
    • Variables API

    This last one because I have no idea what Variables API is for or why its installed! So click the Uninstall button and…
    I’m confused! The page stated the selected modules have been uninstalled, there are one or two permissions errors for the Image module only but all the modules still appear on the Modules List page but not in the Uninstall page! Not sure how to proceed, so will google this issue before proceeding. It occurred to me, do the modules need to be deleted from the disk to disappear from the Modules List page? And the answer is a resounding “Yes!” Also deactivate, uninstall and delete FileField as that was only installed because ImageFiled required it. This appears to leave the system in the perfect state to be upgraded.

Back To Square One!

So it’s back to,square one. Lessons learnt and needing validation by starting again.

And the lesson? Do what it says in the upgrade steps. My mitigation is that I didn’t really know for sure which Modules needed to go but now I do.

  • Anything to do with the Images Module, which means everything in the Image section and the ImageCache section
  • Also everything on the Other Section as I never use the Advanced Help, Thickbox is deprecated (to be replaced by Colorbox) and I haven’t a clue what the Variables API is for.

So do a complete clean down by deleting everything in /var/www and dropping the database with the idea of starting with a fresh ‘snapshot’ of Production from UK2. But Drupal have released a new security update, so that needs to be applied online first.

So with Drupal 6.30 applied online I took a database back up ready to start over again. Moved it to Raspberry Pi via Pippin and in mysql shell dropped the old cnueu_drupldb database, created it again with the same name and used source localhost.sql to add the content of the latest backup to it. It is now ready for the first rehearsal of the upgrade process I’ve come up with. The only question I haven’t answered yet is “should I run the repair script again the database before I upgrade D6 core to D7 or not?

Module Upgrade

So now that the Zen Upgrade has achieved about 95% of the old site appearance the 80-20 rule says move on to the Modules upgrade.

  1. First task is to uninstall Image and all the associated modules. Then delete their folders in sites/all/modules. Except ImageCache and ImageField won’t uninstall, preventing Image API and FileField from being uninstalled too. (Leave ImageCache and ImageField uninstalling in session overnight. But it still ended up as ‘White screen of Death’!) Thinking back I believe I should have uninstalled and deleted all the D6 unwanted after I’d deactivated them before upgrading to D7. Looking now like a big mistake. May need to go for a re-run! 🙁
    And by rolling back the VM to Snapshot D6 Step 1-5 I proved this to be true. Using uninstall on all the Image and related modules worked fine before the upgrade.
  2. Replace old (D6) ACL, Book Access and Forum Access folders in sites/all/modules folder with new (D7) copies. Run https://c-n-u.eu/wp/update.php to update them in the database. These completed successfully. Then activated ACL, Book Access and Book Access UI, but Forum Access requires the Chain_menu_access Module installing and activating to be activated.
  3. Replace old (D6) Views folders in sites/all/modules folder with new (D7) copies. Run https://c-n-u.eu/wp/update.php to update them in the database. These completed successfully. But before Views and Views UI can be activated Ctools needs to be downloaded, installed and activated, so do so.

Zen Upgrade

After many hours over many evenings I have arrived at the knowledge that most of my branding edits are added to the Normalize.css file in the CSS folder of the CNU theme folder in sites/all/themes folder of the Drupal installation. For now (but I might learn how to ‘normalise’ it later) the banner edit is in the Responsive.css file in the sub-folder Layouts. It’d be nice if I could get all the edits into the Normalize.css file eventually. In the meanwhile…

The mark up for the C-N-U branding as captured is:

/* Insert into Body selector */
background-color:#eefae5; /* C-N-U edit: make all pages pale green */
color:#435444; /* C-N-U edit: sets font color to dark green on all pages */
font-family:Arial,sans-serif; /* C-N-U edit: sets the typeface for the whole site */


a:link {color:#435444;} /* C-N-U edit: Link Dark Green Font Colour */
a:visited {color:#432444;} /* C-N-U edit: Visited Link Very Dark Green Font Colour */
a:hover {color:#438444;} /* C-N-U edit: Hover Over Link Mid Green Font Colour */


color:#438444; /* C-N-U edit: Headings Mid Green Font Colour in H1 and H2 etc class declarations */


/* Insert into menu region classes */
background-color: #daefc9; /* C-N-U Edit: set menu background to slightly darker pale green for menus in Responsive.css file */

First Customisation Experience

The first thing that I discovered was that I could not VNC onto the RPi. A bit of googling revealed that a VNC server is not a standard part of the build. SUDO APT-GET INSTALL TIGHTVNCSERVER quickly downloaded and installed it, followed by VNCSERVER to start the first session running on port 5901. Access from VNC clients on Mac and iOS works beautifully.

Next was to transfer the Drupal file system and database from the VM to it. Wheezy proved to be not at all straightforward. USB devices do not auto amount in the shell and I want to use the GUI as little as possible. SUDO APT-GET INSTALL USBMOUNT adds the needed auto-mount facility. But then I hit the next ‘snag’.

All my transfer devices are formatted in EXFAT for maximum sized files and cross compatibility. But Raspbian does not support it as supplied. However a quick SUDO APT-GET INSTALL EXFAT-FUSE overcame this last obstacle.

Looking back: all the above was not such a good idea, I’ve learned to use FTP via Pippin and just wish I could mount its SAMBA share to make it even easier, but hey-ho that time-bandit has had enough of my ‘leisure’ time for now. Rebuilds have blown away the expat-fuse and usbmount additions.

First Experiences

Assembly is a doddle. It took less than 10 minutes to unpack and assemble the kit ready to connect and power up. The PSU is neat and the SD card was 8GB not the advertised 4GB but it is micro-USB with a snazzily Raspberry logo’ed adapter provided

As I was unsure whether SSH access was possible when it booted into the NOOBS installer I dug out a USB keyboard and mouse and connected it to the HDMI port on the telly. The install of Raspbian (a shortening of Raspberry Debian) Wheezy took less than twenty minutes. I took it upstairs and hooked it up to the network in its working location next to the two NAS boxes.

Access using the SSH command in a Mac Terminal session is easy and the iOS app WebSSH is a delight to use.

(*** Tried it and it don’t work despite much Googling and troubleshooting – tried MOUNT command and editing /ETC/FSTAB ***)

C-N-U Zen Theme Notes

This page is a bunch of snippets from the D6 Zen-based C-N-U Theme CSS file for reference in building a D7 replacement.

body
{
margin: 0;
padding: 10px;
background-color: #eefae5 /* A very pale green */
}

————————————————————————————————-

#header-inner
{
background-image:
url(‘/sites/all/themes/cnu/images/CandyRide.png’);
background-repeat: repeat-x
}

————————————————————————————————-

.breadcrumb /* The path to the current page in the form of a list of links */
{
padding-bottom: 0; /* Undo system.css */
font-size: 75%; /* Make breadcrumb smaller */
}

————————————————————————————————-

h1.title, /* The title of the page */
h2.title, /* Block title or the title of a piece of content when it is given in a list of content */
h3.title /* Comment title */
{
margin: 0;
color: #438444 /* Font dark green */;
}

————————————————————————————————-

/** sidebar-left **/
#sidebar-left
{
}

#sidebar-left-inner
{
background-color: #DAEFC9 /** A mid-green **/
}

————————————————————————————————-

/** sidebar-right **/
#sidebar-right
{
}

#sidebar-right-inner
{
background-color: #DAEFC9 /** A mid-green **/
}

————————————————————————————————-

/** footer **/
#footer
{
}

#footer-inner
{
text-align: center;
font-size: 70%
}

#footer-message /* Wrapper for the footer message from Drupal’s “Site information”
and for any blocks placed in the footer region */
{
}

————————————————————————————————-

#footer-inner
{
text-align: center;
font-size: 70%
}

Module Upgrade Woes

There are two parts to the modules upgrade. The Themes Module and the Contributed Modules. All need to be replaced with D7 versions, which is where the woes began. Thinking that the database corruption was going to be the worst of my problems and once resolved all would be plain sailing I was not expecting to find a bigger problem! Namely that not all our Contributed Modules had made it into the D7 world.

The worst being Images and associated modules that had become the well worn path trodden to inserting an image into the content via Gallery. Post upgrade we are left with the dozens of images still in the web site and no way to view them or exploit them.

Formatting content was a pain needing manual insertion of HTML tags so we have agreed that a WYSIWYG module is needed to make formatting text easier and capable of inserting images inline too. As yet a gallery option has not offered itself either but when it does Thickbox will also need to be replaced by something like Colorbox or similar.

I decided to tackle the Theme Module upgrade first. Fortunately Zen has made it to the D7 world and deploying it was the usual process of download, extract, delete old and move new into place. But that doesn’t apply to the C-N-U sub-theme as that is my customisation. The online documentation for ‘upgrading’ a sub-theme from D6 to D7 is highly confusing and even contradictory so I decided that the cleaner approach was to do it again from scratch. So all my free time has gone on reverse engineering what I did the first time round in the D5 world that did upgrade easily into the D6 world. D7 is such a major upgrade in preparation for D8, HTML5 and responsive web sites for device independence that it didn’t just roll forward this time, hence the conclusion the to start again. I have now got to the point where I have the core ‘branding’ analysed and captured in a web page.

NB: In studying how to do the new C-N-U Zen sub-theme it is becoming clear that much of the good practice that Zen follows has now been written into Drupal itself so a future option may be to write a ‘native’ sub-theme and drop Zen too?

Core Upgrade Success

I now have completed the core upgrade successfully by following the upgrade steps 1 – 13 in https://drupal.org/node/570162 using D7.24 and the latest version of the ‘repair’ script as I now call it.

Step 14 was to take a database backup, substituted by a snapshot. Then step 15 was to Upgrade Fields, meaning migrate data from D6 CCK into D7 Fields within core. (There are some notes in Pages on my iMac I need to insert here later.) And that got me a snapshot of a completed Core Upgrade that I can roll back to in a pinch

GF Orange Cake recipes

GF Orange CakeThis is the one that Douglas made from Tom Kerridge on his Christmas Special programme. http://www.bbc.co.uk/food/recipes/spiced_orange_cake_with_47262 for an easy gluten free cake recipe.

And this version http://www.bbc.co.uk/food/recipes/st_clements_cake_with_96717 is from Lawrence Keogh on episode 4 of Christmas Kitchen.

Roll-back Script Test

So I need to test this before letting it loose on the live site. So the plan is this:

  1. Take a new backup from live site database
  2. Restore the database from live and do a new snapshot of the C-N-U on D6.29 VM
  3. Run the roll-back SQL script
  4. Validate the site afterwards

If all goes well then I should do the D6 to D7 upgrade again at least once to ‘validate’ at a repeatable process, and that VM can become my ongoing pre-prod system by cleaning out all previous snapshots. Or be transferred to the Raspberry Pi now?

Post-upgrade Notes

Need to allow our users to set their own time zones – upgrade page contains a reminder to set this.

Also default time zone is UTC so need to set it to GMT (Europe/London) to ensure that summer time is applied

D7.24 is out so need to apply that to be compliant! (Mebbes tomorrow?)

This is worth trying on premise at some point:
Upload progress Not enabled
Your server is capable of displaying file upload progress through APC, but it is not enabled. Add apc.rfc1867 = 1 to your php.ini configuration. Alternatively, it is recommended to use PECL uploadprogress, which supports more than one simultaneous upload.

Upgrade Blues Rollback SQL Script

— This script is probably a one-off!
— Created to undo the damage of the original D6 to D7 upgrade to the live site before rehearsing on premise

USE cnueu_drpldb;
ALTER TABLE system DROP INDEX system_list;
ALTER TABLE `url_alias` DROP `alias`;
ALTER TABLE `url_alias` DROP `source`;
ALTER TABLE `menu_router` DROP `delivery_callback`;
ALTER TABLE `menu_router` DROP `context`;
ALTER TABLE `menu_router` DROP `theme_callback`;
ALTER TABLE `menu_router` DROP `theme_arguments`;
DROP TABLE `role_permission`;
DROP TABLE `date_formats`;
DROP TABLE `date_format_locale`;
DROP TABLE `date_format_type`;
RENAME TABLE d6_date_formats TO date_formats, d6_date_format_locale TO date_format_locale;
CREATE TABLE IF NOT EXISTS `actions_aid` (`aid` varchar(255) NOT NULL DEFAULT ‘0’);

And that’s it! Database repaired enough for the update utility to run. What next?

Upgrade Blues!

I am in the process of a long and complicated repair of the web site MySQL database on a pre-prod Drupal VM server because when I attempted this Drupal 6 to 7 upgrade on the live site last year it all went wrong. I managed to get it back but unfortunately it has left a ‘legacy’ of a partly upgraded database that now, following common sense by using a pre-prod environment, won’t upgrade! I am having to invoke each error and write a back-out SQL command and add it to a rollback script and execute it so I can invoke the next error. I grindingly repetitive roundabout! I will post the resulting script here.

Basically this is the process documented here: https://drupal.org/node/570162 but… It all went horribly wrong at step 13! The update.php threw a SQL error and would not complete. After a few hours of investigation I find I am having to invoke each error and write a back-out SQL command and add it to a rollback script and execute it so I can invoke the next error. I grindingly repetitive roundabout!

I will post the resulting script here. After which I will test it on a VM of D6.29 and the latest C-N-U backup to make sure I get a repaired and upgradeable database.

Second Weekend Blighted By Cold!

This is the second weekend blighted by the cold we both came down with last Saturday. Lynne’s appeared to breaks in 48 hours while mine has dribbled and snivelled all week! But then Lynne’s has come back worst than ever on Thursday evening.

Still, supper last night was very good!

Beware of Ownership

When a Drupal distribution is downloaded and put into place it seems to come with the distributers ownership and permissions.

Ideally in a VM the owner of everything needs to be Apache, so running a chown -Rvf apache:apache * from the root folder of the web site (usually /var/www/html in CentOS) looks like a good idea and habit to get into.

But now we have the Raspberry Pi for on premise that changes to chown -Rvf pi:pi * and the root is /var/www In Raspbian.

Unserendipity!

In looking to see what the word “metastasectomy” meant from a friend’s FaceBook page I stumbled across this snippet in Wikipedia…

“Among colorectal cancer patients, 15-25% will have liver metastases already when the colorectal cancer is discovered, and another 25-50% will develop them in the three years after resection of their primary cancer.[2] Of patients who die from metastasised colorectal cancer, 20% have metastasis in the liver alone.[2]”

Techno-horror of a Weekend!

It started on Saturday afternoon with the tickley-nose conviction that I was getting a cold, whilst Lynne was struggling to upload a calendar. Investigation eventually showed that the hosting server was imposing an 8MB limit that it didn’t used to. It was a real blocker and Lynne and I were both developing a cold.

On Sunday I raised a ticket on the help desk and was assured it wasn’t their side. To cut a long story short I spent hours eliminating the possible perpetrators within our Drupal installation. So I tried to see if I could see the root of my server using SSH and failed miserably. (I need to get my head around the public/private key aspect.) Nett result I found I could not get to the site nor the cPanel! So I raised a critical level ticket before 8pm. As I retired to bed at 11pm feeling a little less ‘dotty-dosed’ I checked the site and ticket: nothing!

Then I noticed the ‘live chat’ button on the hosting support site. Twenty minutes later I settled down to sleep with access to site and cPanel restored (apparently my SSH login attempts had invoked a block on the IP address) and the 8MB limit in the php.ini file lifted to 100MB.

Result!

The Autumn 2013 Trip, Episode 2

We repaired home with the shopping from Mercadona and made lunch, a salad for this warm weather. Then, while Lynne snoozed on the sofa, I managed to restore our Spanish Mi-Fi card.

The afternoon was passed promenading at ‘our end’ of Calpé, the Playa Levante (La Fossa) and drinking tea at Spasso. No free Wi-Fi there anymore but we got a warm welcome. It was good to see Makarpe open again, our very first Calpé haunt, as it’s been shut for several years. It supports the feeling that Spain is picking up again.

We walked down to Bar La Merced, or whatever it’s called now, and had a good long session before wending our way home again. Supper was a slice of tortilla from home and a nightcap of Terry’s, which guaranteed a good nights sleep.

Visiting Gan-Gan

Today, while Lynne was on an all day photography course in Leeds, I took the dogs to visit their Gan-Gan in Newcastle. They really enjoyed seeing her, especially when she couldn’t finish her fish ‘n’ chips and they had to help her out!

Whilst I didn’t think they’d been that energetic while we were there, although they did have a lovely long game of Rar-rars in Gan-Gan’s garden, they were pow-fagged in the evening. “Its the effort of travelling, you know!” I’m sure Helga would say if she could speak.