Restoring call logs to new or upgraded phone
Restoring call logs to new or upgraded phone
I've written a script that converts the CSV file of call logs exported from MyPhoneExplorer to an XML file that can be used with Call Logs Backup & Restore to restore all your call history to an Android phone if you've upgraded the OS (and it deleted your call history) or need to get your call logs from your old Android phone to your new one.
It's a PHP script that needs a web server to run. You can try it here, but I'm not going to leave it up permanently. I've tested it with Android 2.3.4 (upgraded from 2.1) on a Linux/Apache environment, but that's it. It should work in other environments, but I can't make any guarantees.
Does FJ software want a copy to host it themselves?
It's a PHP script that needs a web server to run. You can try it here, but I'm not going to leave it up permanently. I've tested it with Android 2.3.4 (upgraded from 2.1) on a Linux/Apache environment, but that's it. It should work in other environments, but I can't make any guarantees.
Does FJ software want a copy to host it themselves?
Many thanks, i will host it but i'll need the source file, please send it to me zipped via email
Ich bitte um Verständnis daß ich aufgrund des hohen Aufkommens im Forum und meines zeitlichen Rahmens nichtmehr jeden Thread im Forum persönlich lesen bzw. beantworten kann.
Bitte benutzt auch die Forum-Suche bzw. die FAQ
Bitte benutzt auch die Forum-Suche bzw. die FAQ
Actually, it's a very short file, I'll just post the code here:
Copy and save as .php file. Make sure your php.ini file is configured accept file uploads.
Code: Alles auswählen
<?php
// CSV to XML converter for MyPhoneExplorer
// Public domain: use, reuse, peruse and abuse :)
// file uploaded
if (count($_FILES)) {
// open uploaded file for reading
$f = fopen($_FILES['csvfile']['tmp_name'], 'r');
// iterator
$i = 0;
// init output var
$xmlout = array();
// call type (Storage)
$CallTypes = array('DC', 'RC', 'MC');
// loop through CSV data
while ($csvline = fgetcsv($f, 1024, ',', '"')) {
// first line, get headings
if ($i == 0) {
$headings = $csvline;
$i++;
continue;
}
// populate data from headings
foreach ($headings AS $j => $heading)
${$heading} = $csvline[$j];
// generate UNIX timestamp from standard timestamp
list($stampdate, $stamptime) = explode(' ', $Time);
list($yr,$mo,$da) = explode('-', $stampdate);
list($hr,$mn,$sc) = explode(':', $stamptime);
// OUTPUT
$xmlout[] = " <call number=\"$Number\" duration=\"$Duration\" date=\"" . mktime($hr,$mn,$sc,$mo,$da,$yr) . "000\" type=\"" . (array_search($Storage, $CallTypes)+1) . "\" />";
$i++;
}
// file population of data
$xml_start = '<' . "?xml version='1.0' encoding='UTF-8' standalone='yes' ?" . ">\r\n<calls count=\"" . count($xmlout) . "\">\r\n";
$xml_end = "\r\n</calls>";
// output as XML file to save
header('Content-Type: text/xml');
header('Content-Disposition: attachment; Filename="calls-restored.xml"');
echo $xml_start . implode("\r\n", $xmlout) . $xml_end;
exit;
}
// Output upload form...
?>
<div align="center" style="margin-top: 25px">
<div style="font-size: 20px">CSV to XML converter for MyPhoneExplorer / Android Call Log</div>
<div style="padding: 25px; text-align: center; width: 600px; border: 1px dotted #000000; margin-top: 5px">
<form name="csv2xml" method="POST" action="<?php echo $_SERVER['PHP_SELF']; ?>" style="margin: 0px" enctype="multipart/form-data">
CSV file from MyPhoneExplorer: <input type="file" name="csvfile">
<input type="submit" value="convert" style="font-weight: bold">
</form>
</div>
</div>
Zuletzt geändert von epp_b am Mi 6. Feb 2013, 07:04, insgesamt 1-mal geändert.
New Phone
Hi Firstly thanks heaps for the great amazing wonderful software it rocks................I havea samsung galaxy 2 and i dropped it and got a new one, when I sync up it synced with my outlook prefectly however I cannot work out how to sync my sms and calls ...is this possible????
Cheers Mark
Cheers Mark
@epp_b: Many thanks again, its hosted now on my site, you can delete your converter.
@ajeet: Please try the hosted version on my site, since CSV-Files are language specific i had to adapt some things so the right format gets autodetected.
Convert exported call list from MyPhoneExplorer to XML-File for Call Logs Backup & Restore
@mark: For SMS you should use Menu-Extras-Create backup/Restore backup. For calls its currently not implemented but you can use the workaround which is handled in this thread
@ajeet: Please try the hosted version on my site, since CSV-Files are language specific i had to adapt some things so the right format gets autodetected.
Convert exported call list from MyPhoneExplorer to XML-File for Call Logs Backup & Restore
@mark: For SMS you should use Menu-Extras-Create backup/Restore backup. For calls its currently not implemented but you can use the workaround which is handled in this thread
Ich bitte um Verständnis daß ich aufgrund des hohen Aufkommens im Forum und meines zeitlichen Rahmens nichtmehr jeden Thread im Forum persönlich lesen bzw. beantworten kann.
Bitte benutzt auch die Forum-Suche bzw. die FAQ
Bitte benutzt auch die Forum-Suche bzw. die FAQ
Hmm, I didn't actually try to view the log on my phone, I just restored it and it worked. Has this been fixed by FJ already?I tried this utility to generate the xml file. However, there are some errors . The contents cannot be viewed using CallLogBackup&Restore. The dates and time seem incorrect and there is no duration.
Yup, sorry, I should have said that it was English-only (sorry, I only know very little German@ajeet: Please try the hosted version on my site, since CSV-Files are language specific i had to adapt some things so the right format gets autodetected.
The SMS file will use different variables and formatting, so the script would need to be updated to handle that.Hi Firstly thanks heaps for the great amazing wonderful software it rocks................I havea samsung galaxy 2 and i dropped it and got a new one, when I sync up it synced with my outlook prefectly however I cannot work out how to sync my sms and calls ...is this possible????
However, as MPE can restore SMS to the phone, this would be redundant.
Maybe post a sample of the CSV file with the names/numbers changed so we can see what it looks like?Hi FJ, I tried the version on your site but it too does not show the date, time and duration correctly. Perhaps I will send you the calls dat and the corresponding CSV file created. You could maybe look into.
Cheers.
MyPhoneExplorer can already upload messages from SMS-Archive to the phone so no need to create another script
Ich bitte um Verständnis daß ich aufgrund des hohen Aufkommens im Forum und meines zeitlichen Rahmens nichtmehr jeden Thread im Forum persönlich lesen bzw. beantworten kann.
Bitte benutzt auch die Forum-Suche bzw. die FAQ
Bitte benutzt auch die Forum-Suche bzw. die FAQ
[quote="FJ"]@epp_b: Many thanks again, its hosted now on my site, you can delete your converter.
..
Convert exported call list from MyPhoneExplorer to XML-File for Call Logs Backup & Restore
..
Very good
Thanks
..
Convert exported call list from MyPhoneExplorer to XML-File for Call Logs Backup & Restore
..
Very good
Thanks
Android 5
I just tried to use this and had all kinds of errors. I had to adjust for date/time format of USA.
here are my mods.
This one is meant to be run at the command line with your file named export.csv.
ie php export.csv > exportoutput.xml
here are my mods.
This one is meant to be run at the command line with your file named export.csv.
ie php export.csv > exportoutput.xml
Code: Alles auswählen
<?php
// CSV to XML converter for MyPhoneExplorer
// Public domain: use, reuse, peruse and abuse :)
date_default_timezone_set('America/Chicago');
$file = "export.csv";
// open uploaded file for reading
$f = fopen($file, 'r');
// iterator
$i = 0;
// init output var
$xmlout = array();
// call type (Storage)
$CallTypes = array('DC', 'RC', 'MC');
// loop through CSV data
while ($csvline = fgetcsv($f, 1024, ',', '"')) {
// first line, get headings
if ($i == 0) {
$headings = $csvline;
$i++;
continue;
}
// populate data from headings
foreach ($headings AS $j => $heading)
${$heading} = $csvline[$j];
// generate UNIX timestamp from standard timestamp
list($stampdate, $stamptime, $am) = explode(' ', $Time);
$stamptime = $stamptime . " " . $am;
//echo "\n" . $stamptime . " - ";
$stamptime = date("H:i", strtotime($stamptime));
//echo $stamptime . "\n";
list($mo,$da,$yr) = explode('/', $stampdate);
//echo $mo . "-" . $da . "-" . $yr . "\n";
list($hr,$mn,$sc) = explode(':', $stamptime);
//echo $hr . "-" . $mn . "-" . $sc. "\n";
$sc = "00";
// OUTPUT
$xmlout[] = " <call number=\"$Number\" duration=\"$Duration\" date=\"" . mktime($hr,$mn,$sc,$mo,$da,$yr) . "000\" type=\"" . (array_search($Storage, $CallTypes)+1) . "\" />";
$i++;
}
// file population of data
$xml_start = '<' . "?xml version='1.0' encoding='UTF-8' standalone='yes' ?" . ">\r\n<calls count=\"" . count($xmlout) . "\">\r\n";
$xml_end = "\r\n</calls>";
// output as XML file to save
header('Content-Type: text/xml');
header('Content-Disposition: attachment; Filename="calls-restored.xml"');
echo $xml_start . implode("\r\n", $xmlout) . $xml_end;
exit;
// Output upload form...
?>