Results 1 to 1 of 1
  1.    #1  
    It breaks my heart. No more multitasking, no more synergy - no more webOS. It was a crazy ride and I hoped with HP everything will turn out better, it turned out worse.
    Since I don't expect that there will be any more webOS devices in the near future I bought a android phone. With mostly everything in the cloud not a big problem today. But one thing I couldn't get out of the cloud. The messages. All those conversations with you buddies gone forever.?

    I search the web and the forums and bad new first. All you guys with a Pre 2 or a frankenpre (webOS 2.x and above), there seems to be no chance at all to get your messages to another platform.
    But there is hope for those with webOS 1.x. Based on the original webOS internals message export script [1] I created a script that allows you to save your messages in a format this neat [2] app can import on your new phone.

    README:
    1. Rename the file to export_android.pl
    2. Copy this script to your WebOS device (only 1.x) in the folder /var/luna/data/dbdata/
    3. or install ActivePerl [1] on Windows and copy the file /var/luna/data/dbdata/PalmDatabase.db3 to your computer
    4. or Perl on Linux and copy the file /var/luna/data/dbdata/PalmDatabase.db3 to your computer
    5. If you use ActivePerl or Perl install the "DateTime" Perl package
    6. Run this script in the same folder as PalmDatabase.db3 and pipe the messages to a XML file
      e.g. #perl ./export_android.pl > my_webos_messages.xml
    7. Copy this file to your android phone and use SMS backup and restore [2] to import the messages


    If you have any questions, don't hesitate to ask them.

    [1] webos-internals.org/wiki/Tutorials_Export_Text_Messages_Using_Perl
    [2] android.riteshsahu.com/apps/sms-backup-restore

    Code:
    #!/usr/bin/perl
    
    # HP WebOS message export to android
    # Supported platform: HP WebOS 1.x
    # Original export script from webos-internals.org/wiki/Tutorials_Export_Text_Messages_Using_Perl
    # Modified by: Fabian Bader
    #
    # README:
    # Copy this script to your WebOS device (only 1.x) in the folder /var/luna/data/dbdata/
    # or install ActivePerl on Windows and copy the file /var/luna/data/dbdata/PalmDatabase.db3 to your computer
    # or Perl on Linux and copy the file /var/luna/data/dbdata/PalmDatabase.db3 to your computer
    # If you use ActivePerl or Perl install the "DateTime" Perl package
    # Run this script in the same folder as PalmDatabase.db3 and pipe the messages to a XML file
    # e.g. #perl ./export_android.pl > my_webos_messages.xml
    # Copy this file to your android phone and use SMS backup and restore to import the messages
    
    use DBI;
    use DateTime;
    
    $time_zone = 'Europe/Berlin';
    $service_center = "+491760000443";
    # Germany
    # T-mobile = +491710760000
    # Vodafone = +491722270333
    # O2 = +491760000443
    # Base = #491770610000
    # more telespiegel.de/html/sms-kurzmitteilungszentralen.html
    # UK
    # O2 contract = +447802000332
    # O2 Prepaid = +447802092035
    $area_code = "+49";
    # USA = +1
    # UK = +44
    # Germany = +49 
    
    $dbh = DBI->connect( "dbi:SQLite:PalmDatabase.db3" ) || die "Cannot connect: $DBI::errstr";
    
    $output = "<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>\n<?xml-stylesheet type=\"text/xsl\" href=\"sms.xsl\"?>\n<smses count=\"SMSCOUNT\">\n";
    $message_count=0;
    
    $res_user = $dbh->selectall_arrayref( q( SELECT firstName, lastName,chatAddress,id FROM com_palm_messaging_data_ChatThread WHERE _class_id = 11) );
    foreach( @$res_user ) {
    	$first_name = $_->[0];
    	$last_name = $_->[1];
    	$mobile_number = $_->[2];
    	$mobile_number =~ s/^00/\+/;
    	$mobile_number =~ s/^0/$area_code/;
    	$user_id = $_->[3];
    	
    	$res_messages = $dbh->selectall_arrayref( qq( SELECT belongs_id FROM com_palm_messaging_data_ChatThread_com_palm_pim_FolderEntry_Chat_Messages WHERE has_id = $user_id) );
    	foreach( @$res_messages ) {
    		$message_id = $_->[0];
    		$temp = $dbh->selectall_arrayref( qq( SELECT timeStamp, messageText,flags FROM com_palm_pim_FolderEntry  WHERE messageType = 'SMS' and id=$message_id) );
    		foreach (@$temp)
    		{
    			#print "$first_name $last_name $_->[0]\n";
    			
    			$epoch_time = $_->[0];
    			$time = $_->[0]/1000;
    			$dt = DateTime->from_epoch(epoch => $time);
    			$dt->set_time_zone( $time_zone );
    			$message_body = $_->[1];
    			$message_body =~ s/\n/
    /g;
    			if ($_->[2] == 133)
    			{
    				#From me
    				$output .= "<sms protocol=\"0\" address=\"$mobile_number\" date=\"$epoch_time\" type=\"2\" subject=\"null\" body=\"$message_body\" toa=\"null\" sc_toa=\"null\" service_center=\"null\" read=\"1\" status=\"-1\" locked=\"0\" readable_date=\"".$dt->dmy('.')." ".$dt->hour.":".$dt->minute.":".$dt->second."\" contact_name=\"$first_name $last_name\" />\n";
    				$message_count++;
    			}
    			if ($_->[2] == 5)
    			{
    				#To me
    				$output .= "<sms protocol=\"0\" address=\"$mobile_number\" date=\"$epoch_time\" type=\"1\" subject=\"null\" body=\"$message_body\" toa=\"null\" sc_toa=\"null\" service_center=\"$service_center\" read=\"1\" status=\"-1\" locked=\"0\" readable_date=\"".$dt->dmy('.')." ".$dt->hour.":".$dt->minute.":".$dt->second."\" contact_name=\"$first_name $last_name\" />\n";
    				$message_count++;
    			}
    		}
    
    	}
    }
    $output .= "</smses>";
    $output =~ s/SMSCOUNT/$message_count/g;
    print $output;
    Attached Files Attached Files

Posting Permissions