Results 1 to 8 of 8
  1.    #1  
    Yes, its possible. This is a quick howto that i'd like to get some feedback, input and hopefully continually update to make it better and better. I'm NOT 100% sure its perfect... but it has worked for me when using and restore Method One.

    There are 2 ways I've found to do a local backup, that does get contacts, messages, etc, etc... but they do require the Pre to be rooted and/or have Terminal.

    One - Tar the databases
    Two - Use sqlite3 to extract sql dumps

    I've verified with Method One that it does work, Method Two is possible.. but not without alot more work

    Both methods require this first:
    Do a search for "Patch_webOS_Make_USB_Partition_Writable_via_SFTP" (I can't post links)
    As it makes it ALOT easier for getting the backups off, when using as a USB Drive.

    Method One Backup:

    Create a file called backupall and place the following code in it
    # Date Stamp
    DATELONG=`date +%Y-%m-%d_%Hh%Mm`
    DATESHORT=`date +%Y-%m-%d`
    # Back directory location e.g /backups
    tar czf $BACKUPDIR/$DATESHORT/_var_luna-$DATELONG.tar.gz /var/luna
    Using Windows or Linux:
    Place the file on the Pre USB

    Using Pre Terminal or Putty:
    mkdir /media/internal/backups
    mv /media/internal/backupall /opt/bin/backupall
    chmod +x /opt/bin/backupall

    Using Pre Terminal or Putty, type the following to get a backup:
    You will now see backups being created and dated in /media/internal/backups/

    Method One Restore:

    Create a file called and place the following code in it
    mv /var/luna/data/ /var/luna/data-old
    mv /var/luna/files/ /var/luna/files-old
    mv /var/luna/launchpoints/ /var/luna/launchpoints-old
    mv /var/luna/preferences/ /var/luna/preferences-old
    tar -zxvf _var_luna.tar.gz
    cp -r /media/internal/backups/restore/var/luna/* /var/luna/
    Using Pre Terminal or Putty, type the following:
    mkdir /media/internal/backups/restore
    Using Windows or Linux:
    Place the file on the Pre USB in that restore directory
    Copy the backup file that you want to restore to the same restore directory
    Rename the backup file (Should look something like this _var_luna-2009-09-29_13h55m.tar.gz) to _var_luna.tar.gz

    Using Pre Terminal or Putty, type the following:
    sudo -i
    mount -o remount,rw /
    sh /media/internal/backups/restore/
    mount -o remount,ro /
    If you want to clean the backups of the original data, and the files that you extracted
    Using Pre Terminal or Putty, type the following:
    rm -r /media/internal/backups/restore/var/
    rm -r /var/luna/data-old
    rm -r /var/luna/files-old
    rm -r /var/luna/launchpoints-old
    rm -r /var/luna/preferences-old
    I'm just a hack at linux, so im pretty sure things could be done better or differently.. and I definately want to hear feedback.

    Issues with Method One:
    Don't backup a 1.1 and restore to a 1.2, it will cause issues due to the databases changing!!

    Method Two Backup:

    This doesn't have a walkthru, since im still playing around with it but here are some notes/ideas!

    Do a search for "SQLite2009 Pro Enterprise Manager" and get that (I can't post links)
    Pre's use a database called sqlite3

    So if you grab some of the .db3 files, you can open and view data.

    To find .db3 files, use the following command using Pre Terminal or Putty:
    find / -name *.db3
    You can also use commands mentioned on these two pages:
    (Can't post links)
    Search for: sqlite.html
    Search for: sqlite_commands_and_general_usage.html

    Using Pre Terminal or Putty, type the following:
    sqlite3 /var/luna/data/dbdata/PalmDatabase.db3 'select * from com_palm_messaging_data_ChatThread' | awk '{printf "<tr><td>%s<td>%s\n",$1,$2 }' >> test.sql
    echo '.dump' | sqlite3 /var/luna/data/dbdata/PalmDatabase.db3 | gzip -c >ex1.dump.gz
    echo '.dump com_palm_messaging_data_ChatThread' | sqlite3 /var/luna/data/dbdata/PalmDatabase.db3 | gzip -c >ex1.dump.gz
    echo 'select * from com_palm_messaging_data_ChatThread;' | sqlite3 /var/luna/data/dbdata/PalmDatabase.db3 | gzip -c >ex1.dump.gz
    Get cron working to backup daily, weekly, etc etc
    Have someone clean up and write better/safer code
    Figure out easy methods to use sqlite3 to export and import

    Once again.. I'm NOT responsible if something bad happens!!
  2. #2  
    OK, so just my experience... I am not a linux noob, but I am a novice. Familar with command line interfaces since DOS....

    I couldn't get the backupall file to run when I typed sh /opt/bin/backupall
    I get errors on the blank lines, aka line 2, 8 and 10 I think.
    However by just manually entering the lines into Putty I got the backup file and was able to copy it to Windows.
    I have done 3 WebOSDoctor resets so I thought this would be a great way to keep a backup of all tweaks, apps, app settings, etc. So if I goof it again, then I don't have to go thru the hassle of installing all 20 tweaks and patches plus who knows how many other apps.
    Many thanks...
    Just to sum up, if I do a restore all the HomeBrew apps and tweaks will be there? But not mp3's and the like?
  3.    #3  
    This mostly is for the data. Like messages, and contacts.. not apps or patches installed. I need to get around and revising this, to backup messages, contact, bookmarks, apps order on pages.. etc etc.. just havent had the time.

    Did that help as an answer?
  4. #4  
    That answers it.

    So this doesn't exactly help with all the apps.
    Well thanks anyway. I will keep plugging away.
  5. #5  
    daventx, can you continue progress on this? I have some old backed up .db3 files from one time I had to run WebOSDoctor that I would like to figure out how to merge back into my current db3 file (SMS conversations, specifically). I will pay $$ for a solution, sounded like you were on the path.
  6.    #6  
    i've attempted merging quite a few times, but always ran into issues. Even though the most obvious tables that contained the old messages were copied from one db3 to another, every time i'd get a new message after that the fit would hit the shan and the messages would start messing up. So there was obviously some lil piece that i was missing. I would recommend SQLlite manager for firefox or SQLlite 2009 pro for windows to get the data out of there, that at least gives you a text file to look at / search through with names.
  7. #7  
    I already was able to take the old convo's out of the db. I have those put have never been able to merge them back into the current db. Unfortunately, I don't know SQL at all, so I can't even begin to delve into this. (the re-merging)
    Last edited by optik678; 11/20/2009 at 12:37 PM. Reason: clarification
  8.    #8  
    You can use the above listed tools to do the import. The issue is that to import the messages, you also have to import 3-4 other tables. They all link to each other. And even when i did import the 3-4 tables, as soon as i got a message from the person that i had reimported, all of the messages disappeared. I know it IS possible, it'll just take alot of patience.. which i didn't have at the time.

    For anyone who is interested, these are the tables that i BELIEVE are all linked with messages:


Tags for this Thread

Posting Permissions