Posted on 4 Comments

Installing Android Lollipop 5.1.1 on Samsung Galaxy S2 GT-i9100

Android Robot Logo

The Samsung Galaxy S2 GT-i9100 is still one of the most popular smartphones today. Although, official Android upgrades have been discontinued for this model it is quite easy to install Android Lollipop 5.1 on Samsung Galaxy S2 GT-i9100 using Cyanogenmod 12.1. This post describes the steps needed to install Android Lollipop 5.1 based on an existing Cyanogenmod setup, e.g. CM 11. Additionally, it shows which Google Apps package (“gapps”, Google Play Services) is supported for this setup and guides you through the processing of setting it up correctly.

Backup data

Before flashing the Cyanogenmod 12.1 ROM on your Samsung Galaxy S2 make sure to backup for data. We are going to format /system and all caches, thus erasing your user data and previous settings. Also, in order to install Android Lollipop 5.1 using Cyanogenmod 12.1 on your Galaxy S2 your device needs to be rooted. Have a look at a previous post Installing Android Jelly Beans on HTC Desire Bravo which is still valid to root your Samsung Android device. In case you don’t have Cyanogenmod installed on your Samsung Galaxy S2 GT-i9100 have a look the official CM installation guide for the Samsung Galaxy S2 first before continuing.

Install Android Lollipop on Samsung Galaxy S2 GT-i9100

Once you’ve backed up your data download the latest Cyanogenmod 12.1 nightly for the Samsung Galaxy S2:

and save it to your SD-card. Then, download the latest TK GApps Pico Modular Package:

Make sure to choose the Pico Modular Package as the Samsung Galaxy S2 has some memory constraints that probably will lead to errors for other package types. Don’t worry, the Pico Modular Package has everything you need to use your favorit Google services, such as Google Play Services and Google Play Store but in addition does not install all of Google’s applications you might not need. Below you find a comparison chart of the different TK Modular Packages available to get an overview of the applications available in the various packages:


Next, boot into Recovery mode (hold Home button, Volume up and Power simultaneously) of your existing CM 11 setup and execute the following steps:

Note: Make sure to backup your data first! Your settings and user data will be lost by executing the following steps!

  1. Wipe data/factory reset
  2. Wipe cache
  3. Mounts and storage => format /system
  4. Advanced => Wipe dalvik cache
  5. Install zip => Choose the CM 12.1 Nightly zip file you downloaded previously from your SD card
    1. do not reboot once finished
  6. Install zip => Choose the TK GApps zip file previously downloaded from your SD card
  7. Reboot

The first reboot will take some time, so don’t worry. After the reboot you now should have a working Android Lollipop 5.1 with compatible Google Apps on your Samsung Galaxy S2 GT-i9100! Simple, isn’t it?

Possible issues / hints

Do not use the Google Apps package officially provided by Cyanogenmod:


These will not work and you will end up with a message saying

Google Play Services, which some of your applications rely on, is not supported by your device. Please contact the manufacturer for assistence.

Also, you will possibly end up with a lot of crashes of Google Play Services and applications depending on this framework, like

“” and Google Apps has stopped working

Instead, use the TK Pico Modular Package as explained above. In case you get an error message while trying to flash TK GApps Pico Modular Package saying

* Incompatible GApps currently installed

make sure to wipe data and format /system first as explained above. TK Gapps can only be installed on top of an existing installation of TK GApps. Thus, you must wipe your system partition before installing any TK GApps package.

In case you have additional notes feel free to leave a comment. Have fun with the latest Android Lollipop 5.1 based on Cyanogenmod 12.1 on your Samsung Galaxy S2 GT-i9100!

Posted on Leave a comment

Manually update WordPress

Wordpress Logo

So you want to manually upgrade your WordPress installation since the one-click update option is not available due to an ancient (pre 2.7) version or missing file permissions. Although using the one-click update option is the most comfortable one you can almost as easily update WordPress manually. The following steps show you how to manually update WordPress.

Backup database

As usual make a backup of your database and your files. In case you don’t have access to tools such as phpMyAdmin or a shell terminal with proper permissions to export your database have a look at Shuttle-Export, which is an easy to use PHP based MySQL dump library. Make sure to remove this tool after the upgrade process again or protect it with .htpasswd since you most likely don’t want strangers to export your database.

Deactivate plugins

Next, before removing files from your existing installation make sure to deactivate all plugins.

Remove existing installation files

Once again, make sure you have backed up your data and deactivated your plugins. Then remove all files and folders except the following from your installation:

  1. /wp-content
  2. /.htacess
  3. /wp-config.php

Copy new files

Afterwards, copy all files and folders from your new WordPress version, thus overwriting existing files except the ones mentioned above.

Database upgrade

Now it’s time to check if a database upgrade is necessary. Thus, navigate to /wp-admin/. If your are asked click on the upgrade database button. Once this is done click continue and re-login into the dashboard as admin.

Final checks

Finally, check your settings and enable your plugins again. Also check for possible plugin updates. This is all there is to manually updating WordPress. Almost as easy as the one-click update, right? Make sure to remove or password protect your Shuttle-Export installation. You’re all set!

Posted on 1 Comment

Magento produces duplicate customer EAV entries instead of updating existing ones

Magento Logo

In a recent Magento project updating customer entities resulted in duplicate EAV entries instead of updating existing ones. Some of the symptoms of this problem were:

  • Customer attributes not being updated, instead new duplicate entries produced
  • Password reset not working, instead duplicate entries produced
  • Login not working

In general, anything related to updating customer EAV entries caused duplicate entries. Furthermore, although new (duplicate) entries were generated still only the old values were taken into consideration. Thus, having a closer look at the corresponding database tables revealed that the unique indexes over entity_id and attribute_id for these tables were missing, e.g. customer_address_entity_datetime:

Magento missing unique index

… which actually should look like this:


Due to the missing unique index over entity_id and attribute_id columns (here UNQ_CUSTOMER_ADDRESS_ENTITY_DATETIME_ENTITY_ID_ATTRIBUTE_ID) entries were not updated but rather duplicated, as shown below for entity_id 37339 and attribute_id 29:


Apart from the missing unique index also the index for entity_id was missing too.

How to fix it

Note: Make sure to backup your database before adding the required indexes!

We need to add unique indexes over entity_id and attribute_id for all EAV tables. This includes tables ending in

  1. _entity_datetime
  2. _entity_decimal
  3. _entity_int
  4. _entity_text
  5. _entity_varchar

But, since duplicate entries already exist we first need to clean up the corresponding tables.

Remove duplicate entries

In order to remove duplicates while keeping the newest values only we can use the SQL query for customer_address_entity_int, as shown below:

Again: Make sure to backup your database first!

DELETE caei1 
FROM customer_address_entity_int caei1,
customer_address_entity_int caei2 
WHERE caei1.value_id < caei2.value_id 
AND caei1.`entity_type_id` = caei2.`entity_type_id` 
AND caei1.`attribute_id` = caei2.`attribute_id` 
AND caei1.`entity_id` = caei2.`entity_id`;

In case you want to test it with one entity_id first simple append e.g.:

 ... AND caei1.`entity_id` = XYZ

Do this step for all related EAV tables.

Add unique indexes

Now that duplicates have been removed we can add the required unique indexes over entity_id and attribute_id for all related tables. For instance, the following query adds a unique index over entity_id and attribute_id for table customer_entity_varchar:

ALTER TABLE `magento`.`customer_entity_varchar` 

Furthermore, check that there exists an index for entity_id too (this was missing in this setup too):

ALTER TABLE `customer_entity_varchar` 

That’s it! Based on the added (and required) unique indexes Magento will automatically overwrite any existing EAV entrues, thus updating them instead of creating new ones.

Posted on Leave a comment

Fixing ownCloud 6.0.3 upgrade problem on Asustor Data Master (ADM)

Unfortunately, trying to upgrade ownCloud on an Asustor AS-602T to version 6.0.3 running Asustor Data Master (ADM) 2.1.1.R3B2 resulted in a corrupted installation. Even removing and re-installing ownCloud via the App Central didn’t solve this issue.

So, in order to solve this issue and remove your corrupted ownCloud installation from your system first remove it via the App Central and then SSH to your NAS and remove the following folder:

NOTE: The following command will remove your installation and settings!

root@NAS:/volume1/.@plugins/AppCentral # rm -rf owncloud/

This fixed the ownCloud upgrade problem and I was able to install ownCloud 6.0.3.