Monthly Archives: April 2012

Samsung Galaxy S2 ICS Upgrade

Last weekend I successfully upgraded by Galaxy S2 to Ice Cream Sandwich, the latest version of the Android Operating System.

The upgrade was OK although I did need the Vodafone Ice Cream Sandwich Forum to get a couple of issues resolved.

Here’s the process I followed.  Disclaimer: these worked for me, but I don’t guarantee that this work for you.  These instructions are without any kind of warranty.. Always ensure you backup your phone.

Step 1: Backup photos, media, phone numbers and anything else you want from your phone.  For me, I decided I would copy over my music post-install, so I just backed up my photos to a PC using the USB lead.

Step 2: Factory reset your phone: *2767*3855#
Caution: this wipes EVERYTHING on your phone and puts it back to the state when you first had it.  When the reset completes, don’t both entering your Google account as we’ll be wiping it again post-upgrade.

Step 3: Update KIES.  In fact, what I should really say here is uninstall KIES, reboot your PC and then install the latest version of KIES (available from Samsung GT-I9100L Downloads).

Step 4: Start KIES

Step 5: Attach phone

Step 6: Start upgrade

Note: I encountered the following problem:

KIES - PC Failed to recognise the phone.

This happened after the firmware has been downloaded, the Android man was appearing on the handset with the message “Downloading…do not turn off target”. It was sort of as though the handset could not download from the PC.

For me, the solution was to restart KIES, disconnect and reconnected phone. In fact, now that my upgrade is done, I’m wondering if this was down to the fact that I had upgraded KIES using it’s “Check For Update” rather than a clean un-install, re-install as mentioned in Step 3.

Step 7: Allow upgrade to complete

Step 8: Perform a Factory reset by dialling *2767*3855#

This was mentioned on the Vodafone forums – apparently KIES/Android may have left some of the older Gingerbread 3.2.5 files around on the phone and this would clear it? In any case, pre-upgrade my phone would stop playing music or podcasts and random times and others had reported that a factory reset would do this. So, cleaning up would mean nothing to lose.

Step 9: Sync your google account. By default most of your Google Play apps will be re-installed, but if you downloaded any apps manually, you may have to apply them again manually. An important tip: Switch off the mobile/cell data network and connect to a WiFi signal while you perform the sync – you will save your data allowance.

Tikiwiki Migration to WordPress Notes – Part 3

After migrating from TikiWiki, you will probably want to rewrite any old links to the new pages. In my case, all of my articles had a url ending articleXXX.html. If you have any links in the database that were using these names, you can find them with this:

grep -o “….article[0-9]….” dump.sql

Where dump.sql is a MySQL dump of your WordPress database. You can then update any articles using the WordPress editor accordingly.

To catch external sites that may have references articleXXX.html or (in Tiki’s default formats of tiki-read_article.php?articleId=XXXX or tiki-print_article\.php?articleId=XXX) then the following apache rules should do the job:

rewritecond %{HTTP_HOST} ^www\.richii\.com(:80)?$ [NC]
rewritecond %{REQUEST_URI} ^/tiki-read_article\.php$ [OR]
rewritecond %{REQUEST_URI} ^/tiki-print_article\.php$
rewritecond %{QUERY_STRING} articleId\=([0-9]+)
RewriteRule ^(.*)$ http://www.richii.com/?p=%1 [R]

RewriteRule ^/article([0-9]+)([A-Za-z.]+)$ /?p=$1 [R=301,L]
RewriteRule ^/article([0-9]+)$ /?p=$1 [R=301,L]

That should send people from articleXXX.html to /?p=XXX. Then, if WordPress is using SEO-friendly URL’s, it will then send folks to /seo-friendly-article-name

Whilst of the subject of links, it’s worth checking that all of your outbound links are good. A good module that can do this is Broken Link Checker. To set this up, first activate Broken Link Checker in modules. Then go to configure and select:

Which Links to Check: Add:
Embedded YouTube videos
Embedded YouTube videos (old embed code)
Embedded DailyMotion videos

Protocols and API’s:
YouTube API

Check the plugin website for more documentation of this plugin.

One nice WordPress Plugin is WPTouch. I’m not sure if there’s a similar feature in Tikiwiki, but this plugin converts a WordPress site into an application-like theme, complete with ajax loading articles and effects when viewed from the mobile devices like the iPhone, iPod touch, Android mobile devices, Palm Pre/Pixi and BlackBerry OS6 mobile devices.

The install is fairly simple, just search for WPTouch in the Plugins section and download and activate it.

To configure it, just go to Settings -> WPtouch

One option you may wish to disable:
Enable Email Menu Item (Uses default WordPress admin e-mail)

Finally, you will probably want a Contact Form of some sort. One that comes highly recommended in many guides is Fast Secure Contact Form. Install through the Plugins Menu and you’ll then the options under Plugins -> Fast Secure Contact Form Options. You can probably accept the defaults, but perhaps disable “Accept Meeting Requests via vCita”

Tikiwiki Migration to WordPress Notes – Part 2

This article follows up on Tikiwiki Migration to WordPress Notes – Part 1. You’ve now got a working WordPress site with your old TikiWiki articles in it. However, there’s some further imports we can do to use some of the Tiki features such as topic images.

One nice feature in Tikiwiki is that each article/topic was assigned an icon. To get these icons into WordPress, there are a couple of steps.

First, you’ll want to upload your topic images from Tikiwki into WordPress. The easiest way to do this is to install the plugin Add From Server. Once installed, check the settings under Settings -> Add From Server.

Under User access Control select:
Any users with the ability to upload files listed below : admin

Copy over images from Tikiwiki (probably in images/topics) to /path/to/website/wp-content/

Then click on media -> Add From Server

The images should all get uploaded and appear somewhere like /path/to/website/wp-content/uploads/2003/11/stuff.gif

The next step is associate each icon with a category. This is done in the WordPress database.

I should stress at this point that the following steps are at your own risk and are unsupported. Although this worked for WordPress 3.3.1 in my environment, there’s no guarantee that this will work for you. And ALWAYS back up your database prior to performing any database changes.

Here’s the basic process.

The uploaded files now appear in the wp_postmeta table. Let’s say I want to associate all the ‘dotdance’ topics with my dotDance icon.

Step1: Identify the post_id for the image you want to use:

mysql> select * from wp_postmeta where meta_key=’_wp_attached_file’;
+———+———+——————-+——————————+
| meta_id | post_id | meta_key | meta_value |
+———+———+——————-+——————————+
| 716 | 325 | _wp_attached_file | 2003/11/dot_dance.gif |

Make a note of the post_id associated with the image.

Step 2: Next we look in wp_terms to find the dotDance category:
mysql> select * from wp_terms;
+———+——————————+——————————+————+
| term_id | name | slug | term_group |
+———+——————————+——————————+————+
| 9 | dotDance | dotdance | 0 |

Step 3: We need to match this term_id with the term_id in the wp_term_taxonomy table:

mysql> select * from wp_term_taxonomy where term_id=’9′ and taxonomy=’post_tag’;
+——————+———+———-+————-+——–+——-+
| term_taxonomy_id | term_id | taxonomy | description | parent | count |
+——————+———+———-+————-+——–+——-+
| 16 | 9 | post_tag | | 0 | 49 |
+——————+———+———-+————-+——–+——-+
1 row in set (1.91 sec)

Step 4: We now need to find all posts with this term_taxonomy_id=16 (dotDance) category:

mysql> select * from wp_term_relationships where term_taxonomy_id = 16;
+———–+——————+————+
| object_id | term_taxonomy_id | term_order |
+———–+——————+————+
| 26 | 16 | 0 |
| 56 | 16 | 0 |
| 57 | 16 | 0 |
| 63 | 16 | 0 |

So we know post’s 26, 56, 57 and 63 are all in the (dotDance) category.

Step 5: To make these posts use our image (image id 325 found in step 1) we can simply insert entries into wp_postmeta as follows:

insert into wp_postmeta (post_id,meta_key, meta_value) values (’26’,’_thumbnail_id’,’325′)
insert into wp_postmeta (post_id,meta_key, meta_value) values (’56’,’_thumbnail_id’,’325′)
insert into wp_postmeta (post_id,meta_key, meta_value) values (’57’,’_thumbnail_id’,’325′)
insert into wp_postmeta (post_id,meta_key, meta_value) values (’63’,’_thumbnail_id’,’325′)

This can be a bit time consuming if you’ve got a lot of categories to import.

To automate the process, we can script this up.

First, create a csv file with two entries per category. The first entry should be the image id (found from ‘select post_id from wp_postmeta where meta_key=’_wp_attached_file’;) and the second should be the term id (found from ‘select term_id, name from wp_terms;’)

For the exmaple of the dotDance Category shown above this would be:
325,9

Once you’ve got your CSV file, you can upload the data into wp_postmeta by running this script:

#!/bin/bash
cat $1 | while read line
do
val1=`echo $line|cut -f1 -d,`
val2=`echo $line|cut -f2 -d,`
echo “insert into wp_postmeta (post_id,meta_key, meta_value) select wp_term_relationships.object_id, ‘_thumbnail_id’,’${val1}’ from wp_term_relationships,wp_term_taxonomy where term_id=${val2} and taxonomy=’post_tag’ and wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id;” >> /tmp/script$$
done
echo “SQL has been generated in /tmp/script$$”
echo “”
echo “Here are the contents of /tmp/script$$”
echo “”
cat /tmp/script$$
echo “Now run this sql as follows:”
echo “mysql -u –username=XXX –password=YYYY –database=ZZZZZ < /tmp/script$$”

Be sure to take a backup of your database before running the script. Here’s how you can confirm it’s worked: Before associating the featured images to the WordPress posts: mysql> select * from wp_postmeta where meta_value=’325′;
Empty set (0.01 sec)

After associating the featured images to the WordPress posts:
mysql> select * from wp_postmeta where meta_value=’325′;
+———+———+—————+————+
| meta_id | post_id | meta_key | meta_value |
+———+———+—————+————+
| 789 | 26 | _thumbnail_id | 325 |
| 790 | 56 | _thumbnail_id | 325 |

If needed, you can remove the topic associations:

mysql> delete from wp_postmeta where meta_value=’325′ and meta_key=’_thumbnail_id’;

To confirm that all is working as expected, just login to WordPress, select an article that’s been assigned to a category and look to see if “Featured Image” has been set. If you are using a theme that displays category images for articles, then it should be displaying these on either the article homepage or the article itself .