Friday, June 5, 2015

Pentaho Kettle 5.3 CE and copy tables data from Postgres to MySql database

My experience with Kettle is really short. I tried to manage use case where data in Postgres database tables should be transferred to Mysql database. In previous article I described how to have Virtualbox/Ubuntu 14.04 with Mysql and Postgres database so this work is useful for my current task.

First step is to install
Installation is straightforward  - unpack zip in new folder and this minimal setup is all that you need. Kettle has Eclipse-based visual editor so Java runtime is pre-requirement (Java8 64bit was ok on my Win8.1 laptop). To access different databases jdbc libraries should be added to KETTLE_HOME\lib directory (Postgres driver is only one already in place).

Some important points from my experience
  • There are different options how to install Kettle - keep everything simple as possible and avoid pdi database. In my experience for development purposes folder/xml based repository is good enough and much easier to manage.
  • There is huge collection of documentation in internet (even youtube videos), but problem is that for different Kettle versions and not all options of Kettle commercial version is available in CE version. My suggestion is to read old Kettle wiki documentation and avoid Pentaho EE documentation, because changes between Kettle versions are not so big. Another option is to download older Kettle version, but I do not find any reason for that (4.4 version is quite popular in forums).
  • If you have previous installation of Kettle in same computer then in %USER%/.kettle directory files will be used by both installations (better is to remove older one).

Kettle task implementation

My task was simple - I have 2 tables in postgres database with data and I want to transfer data in these tables to Mysql database. I have previously installed Virtualbox/Ubuntu 14.04 with Mysql and Postgres databases with 2 tables in both databases with similar structure.

Because simple Transformation with 2 Table Input/Output tasks is to simple solution, then idea was to solve problem in dynamic way. In future any number of tables can be tranferred using same pattern (identical tables structures in 2 databases is prerequisite) and only changes in configuration is needed.

Get names and columns of tables from source DB

First step is to have transformation that reads from DB metadata table names and columns and output is stream of rows consisting Table_name and column_names (column names is list of columns separated by comma)

Solution is Transformation

Table Input -> Add Constraint -> Row Denormalizer -> Copy Rows to result

Table Input.Connection = Postgres Db connection (previously saved in shared.xml)
Table Input.SQL = select table_name, column_name from information_schema.columns where table_schema = 'test' order by table_name, ordinal_position
# Get information from Postgres metadata


Add Constraint (required for Normalizer, adds constant 1 for all rows in stream)
Add Constraint.Name = grouper
Add Constraint.Type = Integer
Add Constraint.Value = 1


Row Denormalizer.The key field = grouper
Row Denormalizer.Group field = table_name
Row Denormalizer.Target fieldname = table_columns
Row Denormalizer.Value fieldname = column name
Row Denormalizer.Key value = 1
Row Denormalizer.Type = String
Row Denormalizer.Aggregation = Concatenate strings separated by ,

Row Denormalizer will concatanate columns (achievable also by sql, but we try to learn Kettle now :-)) and Copy Rows to result will make current transformation output available to next step (Transformation/job) as stream. Idea is to pass this stream as parameters to next step without persisting information in any file/database.

Next step is to have transformation to save data in target db

Get dynamically data from source and save in target db

In this step we will read data from source database table and save it in target database. This would be really simple if it will be implemented in static way

Table Input -> Table Output

We will have same components in our transformation, but table name and column names should be come as named parameters to this transformation. So we will have Transformation properties

Transformation properties.parameters[0].Parameter = table_columns
Transformation properties.parameters[0].Default Value = i,d,t

Transformation properties.parameters[1].Parameter = table_name
Transformation properties.parameters[1].Default Value = test_data

# Default value is optional, but gives option to test transformation without input feed

Table.Input.Connection = Postgres Db connection (previously saved in shared.xml)
Table.Input.SQL = SELECT ${table_columns} FROM ${table_name}
Table.Input.Replace variables in script = Check
# This trick will read columns and table name from named parameters

Table.Output.Connection = Mysql connection (previously saved in shared.xml)
Table.Output.Target schema = test
Table.Output.Target table = ${table_name}
Table.Output.Truncate table = check
# We will always truncate table before loading, we assume that source/target have same field names so field mapping is not needed.

Main job

Now we have 2 separate transformations and we need to feed with every row of first transformation output second transformation to get results. So loop over first transformation output should be implemented and for every row second generation started.

There is really simple and elegant solution in Kettle to solve the problem (even without loop in screen). We need new job with these elements

Start -> Transfomation 1 -> Transformation 2

No changes in properties for job

Transfomation 1.job entry details.Transformation Spec.Transformation name = <first transformation filename>

Transfomation 2.job entry details.Transformation Spec.Transformation name = <second transformation filename>
Transfomation 2.job entry details.Advanced.Copy previous results to parameters = Check
Transfomation 2.job entry details.Advanced.Execute for every input row = Check
Transfomation 2.job entry details.Parameters[0].Parameter = table_columns
Transfomation 2.job entry details.Parameters[0].Stream column name = table_columns
Transfomation 2.job entry details.Parameters[1].Parameter = table_name
Transfomation 2.job entry details.Parameters[1].Stream column name = table_name

Now you have first transformation that will call second transformation for every row in output stream and pass these values as named parameters to the second transformation. If you have data in source database tables then running Main job should transfer data to target tables.

Conclusion

We have very powerful solution to tranfer data from source database to target if table structures in both databases are identical. Main problem during development was to figure out what fields must be filled to pass one transformation output stream as input to next transformation. Actually it took many hours to figure out the second transformation Parameters part, because it is not easy to figure out where is problem with debugging.

Honestly, I was surprised how simple and elegant dynamic solution was possible to develop in Kettle and hopefully it will be my favourite ETL tool in future.


Install on Win8 with vagrant Virtualbox/Ubuntu 14.04 with Mysql and Postgresql database inside

The goal was to have mysql/postgres databases accessible from local computer. I do not like database server installations in my own laptop and therefore VM solution is preferrable. This article describes steps to have ubuntu 14.04 Virtualbox with mysql and postgresql server inside

In host machine (Win8 laptop) first steps are to install
  1. Vagrant 1.8.1
  2. VirtualBox 5.0.12
Vagrant is my favourite tool to manage VM-s from commandline and Virtualbox is best VM provider. After installation open new command line window (cmder is my favourite and cmd.exe is ok also) and make new folder for VM installation. I assume that vagrant.exe is in your PATH.

First steps are to run from commandline in Win8.1 machine
  • vagrant init ubuntu/trusty64
  • vagrant up --provider virtualbox
  • vagrant ssh
You will have VM with ubuntu 14.04 server accessible from commandline with ssh. Next steps are to install mysql database and postgres databases in Ubuntu server guest.

Install mysql database

  • sudo apt-get -y install mysql-server
During installation root password must be provided (and better is to remember it also :-)).  After installation mysql server is up and running, but it is not accessible from host machine.
  • sudo vi /etc/mysql/my.cnf and change bind address line to
    bind-address            = 0.0.0.0 and save file
  • sudo service mysql restart
  • sudo netstat -tap | grep mysql  
Something like 
tcp        0      0 *:mysql                 *:*                     LISTEN      11462/mysqld
should appear on screen

For testing is good to have some test user/database/table
  • mysql -u root -p
    CREATE USER 'test'@'localhost' IDENTIFIED BY 'a';
    CREATE USER 'test'@'%' IDENTIFIED BY 'a';

    GRANT ALL ON *.* TO 'test'@'localhost';
    GRANT ALL ON *.* TO 'test'@'%';
       
    CREATE DATABASE IF NOT EXISTS test CHARACTER SET = 'utf8';
    create table `test_data` ( `i` bigint(20) NOT NULL, `d` datetime NOT NULL, `t` timestamp);
    create table `test_data_2` ( `seq` bigint(20) NOT NULL, `d` datetime NOT NULL);       
Next step is optional, but I prefer to have phpMyAdmin also installed on server so
  • sudo apt-get -y install phpMyAdmin
    Answer (server: apache2) and provide passwords
Last step is to forward host ports to guest server so in Win8 machine run
  • vagrant halt
  • Edit Vagrantfile and add port forwarding
    config.vm.network :forwarded_port, guest: 3306, host: 3306
    config.vm.network "forwarded_port", guest: 80, host: 8010
  • vagrant up
After these steps mysql should be up and running in guest server and accessible from host machine also. You can first validate your mysql server running http://localhost:8010/phpmyadmin in Win8 browser and access your mysql server with any client in Win8 (Oracle SQL Developer for example).

Install postgres server

In guest machine (vagrant ssh from commandline) execute
  • sudo apt-get -y install postgresql postgresql-contrib
  • sudo vi /etc/postgresql/9.3/main/postgresql.conf
    listen_addresses = '*'  # uncomment this line
  • sudo vi /etc/postgresql/9.3/main/pg_hba.conf
    # IPv4 remote connections:
    host    all             all             0.0.0.0/0               md5
    # add previous line to config file and save file
  •  sudo service postgresql restart
For testing is good to have some test user/database/table
  • sudo -i -u postgres
  • psql
    CREATE USER test SUPERUSER ENCRYPTED PASSWORD 'a';
    CREATE DATABASE test OWNER = test ENCODING = 'UTF8';
    ALTER USER postgres ENCRYPTED PASSWORD 'a';
    \c test
    CREATE SCHEMA IF NOT EXISTS test AUTHORIZATION test;
    create table if not exists test_data (i int, d date, t timestamp);
    CREATE TABLE IF NOT EXISTS test_data_2 (seq serial, d date);
In Win8 run    
  • vagrant halt
  • Edit Vagrantfile and add port forwarding
    config.vm.network "forwarded_port", guest: 5432, host: 5432
  • vagrant up
After these steps postgres server should be up and running in guest server and accessible from host machine. You can check postgres with any client in Win8 (pgAdmin or Oracle SQL Developer for example).

Installed software

Software installed in host computer (Win8.1)
  • vagrant 1.8.1
  • VirtualBox 5.0.12
Software installed in guest computer (Ubuntu 14.04)
  •  mysql 5.5.46
  • phpMyAdmin 4.0.10
  • postgreSql 9.3.10

Services accesible from Win8.1 (host)

#   5432 - postgres db (localhost:5432:test/a)
#   3306 - mysql db    {localhost:3306:test/a}
#   8010 - phpMyAdmin  (http://localhost:8010/phpmyadmin {root/a})

Saturday, January 4, 2014

Install Crashplan on Synology NAS DS112+


There is article from authors of CrashPlan Synology version describing installation process (PC Load Letter). This is my version of installation process of CrashPlan to DS112+.
  1. First step is to add Package Center -> Settings -> Package Sources: PC Load Letter | http://packages.pcloadletter.co.uk.
  2. Next step is to install Java SE for Embedded 7.
  3. Download manually Java SE for Embedded 7 that is suitable for you Synology NAS (ejre-7u45-fcs-b15-linux-arm-sflt-headless-26_sep_2013.tar.gz for my DS112+) and copy this file to NAS public folder
  4. Run Package Center -> Community -> Java SE for Embedded 7 "Install". If Java SE for Embedded 7 compressed file is available in public folder then everything should go smoothly.
  5. Next step is to install Crashplan to Synology NAS.
  6. Run Package Center -> Community -> CrashPlan "Install". After installation everything is in place and next step is to configure CrashPlan on NAS server.
  7. Configuration should be done from PC with ssh port forwarding.
  8. Run from PC command line
    ssh -L 4200:localhost:4243 root@<NAS ip-address>
    what will forward PC 4200 port to NAS 4243 port
  9. Change CrashPlan ui.properties file (C:\Program Files\CrashPlan\conf\ui.properties in my case)
    servicePort=4200
  10. Run CrashPlan user interface, change NAS server parameters as necessary and finally press "Save changes"
  11. Remove servicePort=4200 from ui.properties file and configure local CrashPlan (folders to backup and so on).
There is another good article describing same process, if you find any problems during installation. There are also some articles with out-of-date information (specially synology wiki).
After running all these steps you are ready to backup your PC files/directories to Synology NAS server as you configuration describes.

I have added some additional steps (optional) to my configuration. In PC I have configured to run backup every day from 1:00 AM to 6:00 AM. In NAS server I have added these 2 lines to /etc/crontab
0       0       *       *       *       root    /volume1/@appstore/CrashPlan/bin/CrashPlanEngine start
0       7       *       *       *       root    /volume1/@appstore/CrashPlan/bin/CrashPlanEngine stop

So CrahPlan will run on NAS server every day from 0:00AM to 7:00AM.

Cron daemon restart is necessary to make crontab changes effective.

/usr/syno/etc.defaults/rc.d/S04crond.sh stop
/usr/syno/etc.defaults/rc.d/S04crond.sh start

Tuesday, December 31, 2013

How to load CSV file to Mysql database

There some tricks to know how to load csv file to mysql:
  1. mysql -u <user> -p --local-infile
    (the --local-infile is necessary, otherwise you will get error during dataloading: ERROR 1148 (42000): The used command is not allowed with this MySQL version)
  2. use <database>
  3. create table script (create_tables.sql) in text editor
    drop table kontakt;
    create table kontakt
     (klkood        bigint(20)
     ,kontakti_liik varchar(32)
     ,vaartus       varchar(100)
     ,kasutusluba   varchar(100)
     ,keeluaeg      varchar(100)
    );
    create index kontakt_klkood on kontakt(klkood);
  4. run the script from mysql prompt
    .\ create_tables.sql
  5. create load data script (load_data.sql) in text editor
    LOAD DATA LOCAL INFILE '/vagrant/uptime/EA_kliendi_kontaktinfo_3012.csv' INTO TABLE kontakt
    FIELDS TERMINATED BY ';'
    LINES STARTING BY '"' TERMINATED BY '"\r\n'
    IGNORE 1 LINES;
  6. run the script from mysql prompt
    .\ load_data.sql
  7. If there are warnings then execute
    show warnings
For me most difficult part was to get load_data.sql to work and specially --local-infile parameter.

Thursday, December 5, 2013

How to install mysql and mysql workbench in Ubuntu 12.04

Its really simple task to install mysql server and mysql workbench in Ubuntu 12.04. You shuold run from commandline



sudo apt-get install mysql-server
sudo apt-get install mysql-workbench

First row installs mysql server, asks root password and starts mysql service. To restart server run

sudo service mysql restart

Second row installs mysql-workbench and you are ready to access mysql server in localhost.

Tuesday, November 26, 2013

How to make Ubuntu Desktop Vagrant compliant

Its seems me reasonable to have Vagrant compliant Ubuntu Desktop 12.04 even I will not start it from commandline. These steps are necessary:
  1. Create default user as vagrant/vagrant in Ubuntu setup
  2. Add admin group
    groupadd admin
    useradd -a -G admin vagrant
  3. update sudoers (sudo visudo; and add these lines
    Defaults:vagrant !requiretty
    Defaults env_keep = "SSH_AUTH_SOCK"
    %admin   ALL=(ALL:ALL) NOPASSWD: ALL
  4. Add a port forwarding rule in Virtualbox NAT as follows:
        Name: SSH
        Protocol: TCP
        Host IP:
        Host Port: 2222
        Guest IP:
        Guest Port: 22
  5. Install and configure OpenSSH Server
    sudo apt-get install -y openssh-server
    sudo vi /etc/ssh/sshd_config

    and add/modify these lines:
    Port 22
    PubKeyAuthentication yes
    AuthorizedKeysFile %h/.ssh/authorized_keys
    PermitEmptyPasswords no
    PasswordAuthentication no

    restart ssh server
  6. Download vargant public and private key
    $ mkdir -p /home/vagrant/.ssh
    $ chmod 0700 /home/vagrant/.ssh
    $ wget --no-check-certificate \
        https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub \
        -O /home/vagrant/.ssh/authorized_keys
    $ chmod 0600 /home/vagrant/.ssh/authorized_keys
    $ wget --no-check-certificate \
        https://raw.github.com/mitchellh/vagrant/master/keys/vagrant \
        -O /home/vagrant/.ssh/id_rsa
    $ chmod 0600 /home/vagrant/.ssh/id_rsa
    $ chown -R vagrant /home/vagrant/.ssh
  7. Remove file to fix network issues afterward
    sudo rm -f /etc/udev/rules.d/70-persistent-net.rule
  8. Comment out HWADDR row in /etc/sysconfig/network-scripts/ifcfg-eth1 (to fix https://github.com/mitchellh/vagrant/issues/1777 issue)
After that you are ready to create new vagrant box. There are several articles describing same process in depth.

Quick file search in Ubuntu

Quick answer to this simple question is

 locate <filename>

and to update slocate database

sudo updatedb

As always there is also long answer.

Monday, November 25, 2013

Install postgres, pgadmin in Ubuntu 12.04

Installing postgres database to Ubuntu 12.04 run

  1. sudo apt-get install postgresql
  2. sudo apt-get install postgresql-contrib
  3. sudo apt-get install pgadmin3
There is nice article what you can to do further in postgres database.

To allow connection to postgres database from host computer these steps are necessary:
  1. In VirtualBox NAT Advanced settings add port forwarding 5432 -> 65432
  2. In guest start sudo vim /etc/postgresql/9.1/main/pg_hba.conf and add these lines
    host    all    all             192.168.0.0/16          md5
    host    all    all             10.0.0.0/8              md5
  3. sudo vim /etc/postgresql/9.1/main/postgresql.conf
    listen_addresses = '*'
  4. sudo -u postgres psql and execute
    create user vagrant with password 'vagrant';
    create database pentaho;
    GRANT ALL PRIVILEGES ON DATABASE pentaho to vagrant;
    alter user vagrant with superuser;
    \c pentaho
    CREATE SCHEMA repo;
    CREATE SCHEMA target;
  5. In host pgadmin III create new connection
    Name: local
    Host: localhost
    Port: 65432
    Maintenance DB: pentaho
    Username: vagrant
    Password: vagrant

Add shared folder in VirtualBox

In Win7 host, Ubuntu 12.04 guest I tried to add Shared folder, but there are some simple tricks to know.

  1. Add shared folder in VirtualBox (Settings -> Shared Folder -> Machine Folders)
  2. Make sure that the additions are installed, and that you have added your username as a member of the vboxsf group (sudo usermod -aG vboxsf <your username>).
  3. After restart shared folder  /media/sf_shared should be in place
How to install manually guest additions in linux
$ sudo apt-get install build-essential module-assistant linux-headers-$(uname -r) dkms -y
$ wget -c http://download.virtualbox.org/virtualbox/4.0.16/VBoxGuestAdditions_4.0.16.iso
$ sudo mount VBoxGuestAdditions_4.0.16.iso -o loop /mnt

Install Oracle Java 7 to Ubuntu 12.04

Easiest way to do it is to run in terminal

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer

Nice thing is that it keeps java version up-to-date. There is longer explanation with different alternatives in Ubuntu site.

Optional: add to .bashrc
export JAVA_HOME=/usr/lib/jvm/java-7-oracle

Install Ubuntu Desktop in Virtualbox

My idea was to use Vagrant to install and start Ubuntu Desktop. First step is to downloaded Vagrant and then start command line and move into new empty directory.  Next step is to download Ubuntu server

vagrant box add ubuntu64-13.04 http://cloud-images.ubuntu.com/vagrant/saucy/current/saucy-server-
cloudimg-amd64-vagrant-disk1.box

and start it

vagrant init ubuntu64-13.04
vagrant it



ssh into new server and install graphical user interface


vagrant ssh
sudo apt-get install ubuntu-desktop

allow graphical user interface in configuration file Vagrant


config.vm.provider :virtualbox do |vb|
  vb.gui = true

  vb.customize ["modifyvm", :id, "--memory", "1024"]
end

restart the system


vagrant reload

Actually it came out that Ubuntu Desktop graphics is really slooow, so I give up and started install Ubuntu Desktop without Vargant from scratch. Lesson that I learned today: dont use hammer when you have screws. Vargant is not meant to use with graphical desktop.

 

Monday, September 30, 2013

How to check that site is down.

I had problem with Zulutrade website and I try to figure out is problem in my pc/office network or is server actually down. I found simple service http://www.isitdownrightnow.com, where everybody who has problems can report.
Nice service and it works!

Tuesday, September 10, 2013

Installing ODI 11.1.1.7.0 on Windows 7 64bit

It sould be easy to install any software nowadays, but it is not. Specially painful is installation of packages from big companies, because these are huge packages with lot of dependencies.

My last challenge was to install Oracle ODI Studio on my laptop and it was real problem to even start the installer. After some investigation I find this article from google, that solve my problem.

Some important points that I discovered:
  1. Win7 64bit jre and oracle installer are working together (despite some posts that claim otherwise)
  2. Command order to start Oracle ODI installer
    run cmd.exe as Administrator (It does not work without it, despite installer asks Administrator password)
    setup.exe -jreLoc C:\Progra~1\Java\jdk1.7.0_29
Honestly I am disappointed that this information is not provided in Oracle readme :-(

Friday, August 30, 2013

Nexus 4 upgrade JWR66V -> JWR66Y

I have rooted Nexus 4 with Clockmod Recovery and there are always problems with OTA upgrades. After JWR66Y upgrade, which actually go smoothly. The problem is that SuperSU will be overwritten during upgrade and its not accessible anymore.

There is many articles in internet about this issue, but this one is really short description and it works :-). Another question - is rooting really needed, because it can be also security issue, but this is another story.

Monday, May 13, 2013

Duplicate Postgres database

It is unbelievable how easy is to create copy of Postgres database. The only command you need is

CREATE DATABASE newdb WITH TEMPLATE originaldb OWNER dbuser

There are 2 possible issues regarding to command above:
  1. In some cases database name must be quoted (In my case
    CREATE DATABASE "sirene-migration-testing2" 
      WITH TEMPLATE "sirene-migration-testing" OWNER dbuser;
  2. If some other connections are active in source database then error will be thrown (ERROR: source database "sourcedb" is being accessed by other users). There is simple script to kill all other connections in postges database except current connection

    In PostgreSQL 9.2 and above, to disconnect everything except your session from the database you are connected to:

    SELECT pg_terminate_backend(procpid)
    FROM pg_stat_activity
    WHERE datname = current_database()
      AND procpid <> pg_backend_pid();

Tuesday, April 23, 2013

Virtualbox Ubuntu 12.04 admin privilegs problem

I have Ubuntu 12.04 Virtualbox guest in Win7 

I get admin privilegs problem after executing
sudo usermod -G vboxsf jack

I dont had admin(sudo) privilegs anymore and to fix it I found solution, which needed some improvements

  1. boot to recovery mode during Ubuntu Virtualbox startup holding down SHIFT key
  2. login as root and execute
  3. mount -o remount,rw /
  4. usermod -a -G sudo jack
  5. reboot

Sunday, April 14, 2013

HTC Desire Bravo tweaking

In previous post I wrote about my long way to install Cyanogenmod 7.2.0.1 ROM to HTC Desire Bravo. In this post I wrote about my experience how to tweak Android 2.3.7 further.

1. ADW.Launcher is default launcher application for Cyanogenmod. It's ok launcher but old version was installed so I was not able to add widgets to screen. To upgrade ADW.Launcher to latest version is not easy task as somebody can expect:
  • install latest launcher version (trick is that sdcard cannot be used for installation because otherwise launcher is not accessible during bootup and I restored ROM several times before I get it);
  • remove old version with Titanium backup, because old version is in /system/app directory, that must be mounted r/w first;
  • hold down home button, check "default application" and choose AWD Launcher new version
There is also same problem with widgets as launcher - to be added in list of available widgets these must be installed in phone storage. Side knowledge - its really easy to try/switch to any other application launcher. After downloading launcher press home button and select from list new launcher you have installed.

2. After installation and tweaking I got call from my sister and I was really upset if after call I had black screen and any button does not change this situtation. Only solution was to remove battery and put it back. Fortunately there was also solution to this problem - "working fix for the proximity sensor in-call problem".

3. I want to remove splash screen to stock HTC version and there was solution.

4. There are lot of applications for every single need and its not easy task to find right one. There is list of my favourite tools:
  • Superuser - MUST have app, for su access;
  • FX with root access - best file explorer with text file editor;
  • Titanium Backup - best tool to remove applications;
  • ADW.Launcher - lightweight application launcher with lot of configuration options.
5. Conclusion
Mobile phone results after upgrade and tweaking

Cons:
  • battery life is shorter (I will try to calibrate)
  • phone storage has same limits (so low space problem is soon back again - i dont use Link2SD any more) 
Pros:
  •  Android 2.3.7 vs Android 2.2 with better interface (expect contacts) and a lot more options to configure;
  • ADW.Launcher vs HTC Sense - nothing to compare;
  • tons of widgets vs HTC widgets - you get what you want;
  • GPS positioning is working instantly.
Main thing that I learn during last 3 days - how to install custom ROM and recover system. In future I know that nowadays it is quite easy to install custom rom with different tweaks (if you have enough free time :-))

HTC Desire Bravo Cyanogenmod 7.2.0.1 ROM installation

I have never tried install any custom ROM, because I know that after upgrade there can be lot of problems and only internet can help you :-) I thought that it is wise to "not break anything if it works". From other side there were some existing small problems (black screen during call so it was not possible to choose any numbers for answering, old HTC Sense interface, ...) with my phone and if my colleague came and insested to upgrade then I thought - Why not.

Cyanogenmod 7.2.0.1 ROM was ROM that my colleague use and he has very positive experience so it was easy to decide which ROM to install. I installed ROM Manager from Google Play (despite some negative comments) and from ROM Manager I installed ClockMod Recovery and downloaded HTC Desire Bravo Cyanogenmod 7.2.0.1 ROM to my sdcard.

I backup my existing configuration and started upgrade. Problem occurs when Cyanogenmod first time bootup - new splash screen runs and runs and runs ... I was really disappointed and first thing that come to mind was restore from backup. Afterward I know this was mistake, but you must learn from you own experience.

After restoring from backup system bootup, but in really bad shape:
WIFI - ok,
Mobile network - ok,
sdcard - not recognised
usb - unkown device from win7
So I was ready that in worst case I must buy new mobile phone.

In such cases google search is your best friend, but you must be lucky guy to find right article to your problem (and if this article is not in top20 then you will not find it). This day I was lucky guy :-). Article that save my HTC Desire - "USB brick" fix.
After running "fastboot oem enableqxdm 0" and reboot I was able to connect to my sdcard and usb - long step forward :-)

Of course it take much longer to find solution - actually 1 day and there were lot of other things that I try
1. Is sdcard accessible from sdcard reader - of course it was
2. Maybe problem is 2 primary partitions in sdcard - so I do repartioning to 1 4GB FAT32 partition which does not help to recognize my sdcard from phone
3. Some other steps in wrong direction ...

I tried to install Cyanogenmod 7.2.0.1 ROM once again and got same Cyanogenmod start splash screen. Short googling gave me tutorial "How to get out of a bootloop" and it does what it promise!!

From positive side I know much more about Android Custom ROM-s, negative side is that I loose almot 2 days and its not finished yet.

Read next article: HTC Desire Bravo tweaking

Low space problem with my old HTC Desire

I had long time low space problem with my old HTC Desire, so I was forced on to ignore all application updates and new software installation means to remove some existing one. Actually I had accepted my fate and I read reviews to buy new mobile phone until I heard accidentally about Link2SD.


My phone was already rooted and there was excellent tutorial how to install Link2SD software. I have never tried before any custom ROMs so my phone has HTC stock ROM with Android 2.2.Everything go smoothly until I try to run Link2SD first time. It came out that Desire has additional obstacles to copy/move system software - S-OFF.

I find 2 solutions - first one was deprecated and second one was real beta, so not very promising situation :-( My decision was to use older one, because HTC Desire was first phone supported by this software. I followed installation instructions and everything went without problems. There was one side effect - new splash screen instead of HTC "brilliantly quiet" screen, but at this moment it does not disturb me.

So my "low space" problem was resolved and I was able to install additional software to my phone. Afterward I know that this was only small step in my long phone upgrade path :-)

Read next article: HTC Desire Bravo Cyanogenmod 7.2.0.1 ROM installation