[GUIDE] How to restore / import Line chat history!

Search This thread

amakuramio

Senior Member
Nov 28, 2013
716
161
I second this question! As I'm about to move to Oreo, I wonder what works for LINE now. TiBu backup + Android ID change still? The SQlite editor? Built-in save option (within the app)?
Thanks!

In oreo every app has its own ID, but you can install nougat rom then upgrade to oreo and it will keep the old id if you have had it installed prior to upgrading
 

Ghisy

Senior Member
Mar 27, 2010
2,250
1,132
HTC Desire
Google Nexus 4
In oreo every app has its own ID, but you can install nougat rom then upgrade to oreo and it will keep the old id if you have had it installed prior to upgrading

Unfortunately, I can't do that. I'm gonna be switching to a different custom ROM and a clean install is necessary.

Does the TiBu + Sqlite method still work on Oreo then?
 
Last edited:

YandereSan

Senior Member
Sep 1, 2013
205
88
Putting this here in case someone ever breaks letter sealing with Titanium Backup:

How to fix "unknown error has occurred" when attempting to verify identity for Letter Sealing:

1. Disable letter sealing.
2. Using Root Explorer, navigate to /data/data/jp.naver.line.android/databases
3. Delete all files that start with "e2ee".
4. Re-enable letter sealing.
5. Verify identity on PC client.
 

Almighty1

Senior Member
Jun 9, 2010
1,052
279
50
San Francisco, California USA
bit.ly
I used the instructions here:
https://www.techgravy.net/line-chat-history-backup-restore-android/

And all the data in LINE on Android is fine but it seems like I lost everything on the LINE PC version, is there a way to get the LINE data back on the PC version?

Actually, it seems all pictures are missing in the Android, is there a way to fix it since I can always restore from Titanium Backup again.
 
Last edited:

Almighty1

Senior Member
Jun 9, 2010
1,052
279
50
San Francisco, California USA
bit.ly
I used SQlite manager, and for the steps:
Part 9, on the new line folder (which don't have any messages), click the table (on the uper left)->Export table, and on the fields separated by, use the semicolon (;) or pipe (|) (choose what is NOT in the data fields on the table), and on the fields enclosed by, I choose double quotes ("), always. Exported file will be on .csv format
Part 10, on the old line setting folder, click on the 1st cell (top left), hold shift and down arrow until you have selected all cells, then use the delete button on the upper right (add, duplicate, edit, delete), and click on OK when warning signs. Now click on the import icon (beside the folder icon, connect database), choose the CSV, and choose the other as same as what you choose when exporting the new line setting.
Part 11, change the USER_STATUS_ACCESS_WIFI_NETWORK_TIMESTAMP, USER_STATUS_LAST_FOREGROUND_TIMESTAMP, USER_STATUS_LAST_BACKGROUND_TIMESTAMP, APP_LAST_SYNCED_TIME, and the STICKER_SHOP to the timestamp of the old line settings, if you cannot find the same key from the old setting that match to key from the new line settings (I forget the key which is not same), just use the oldest timestamp for it.

Hope it works, sorry for the late response. :eek:

Works fine when I just tried it, I have only used LINE since April 2018 and basically all of the photos are still there which are the ones sent by the contact, the only one photo missing was one and only one I actually sent, not sure why it lost the photo I sent but all the received ones are there. Only issue was Letter Sealing failed which was fixed using the method in post #124.

Is there anyway to have the chat history from Android sync to the PC version as when I used the other method of deleting settings, it asked to login and then did the SMS code verification and while the phone had the chat history without photos, it seemed to have completely wipe the chat history on the Desktop PC version of LINE. I tried restoring the previous Android Device ID after making a current TWRP Backup and then restoring the previous TWRP Backup just to find the Android Device ID and then restored the current TWRP Backup and changed the Android Device ID to the one LINE used during the last Titanium Backup on July 12, 2018 but while LINE worked, it worked for exactly 1 minute as I can basically see the cat history and all but after about 1 minute or less, it says LINE detected I am using LINE on a different device and it will delete my chat history which it did. Did exactly the same thing when I cleared data and restored in Titanium Backup.

I didn't have to uninstall or reinstall LINE 8.10.1 as all I did in Titanium Backup was first restore data, freeze the app in TB, copy the naver_line file as naver_line.old to another folder. Then clear data in Titanium Backup, Defrost app, run, freeze and copy the naver_line file as naver_line.new and then copied both of the old and new files to the PC and made a copy of the old file called naver_line, then edited it on the PC with SQLite Expert Professional. Then sent it back to the device, clear data on Titanium Backup, restore data, copied the naver_line file I uploaded to the correct place, defrost TB and then ran LINE. However, letter sealing was still broken which was fixed using the method in post #124.
 
Last edited:

dimm0k

Senior Member
Jan 25, 2014
1,706
661
Google Pixel 4 XL
some real geniuses here so I was wondering if anyone here has a solution for two problems I'm currently facing with LINE after switching phones. all my chats are intact, which is good, however...

1. for some of the chats the pictures sent are missing (at least to LINE, showing a ! symbol) and even after deleting chat history and restoring from backups for these specific chats they still won't show. if I go to Android/data/jp.naver.line.android/storage/mo I still see some of these images from the past so they're there! any way to get this back into my chats so that everything is in one place?

2. I have a bunch of backed up chats, mostly for active chats, but also a few for chats that are no longer. any way to extract the chats from these zips and read them somehow?
 

desiregeek

Senior Member
Jun 27, 2010
644
33
Anyone here have any new updates on this backing up and restoring chat/chat logs with images. Getting images with all chat logs is important. Once you start transfer to new device all the stuff on old device gets wiped out

Any new and easy way to move all line chat logs/chats along with images from a previous device to a new device?
https://help.line.me/line/android/pc?lang=en
 

dimm0k

Senior Member
Jan 25, 2014
1,706
661
Google Pixel 4 XL
Anyone here have any new updates on this backing up and restoring chat/chat logs with images. Getting images with all chat logs is important. Once you start transfer to new device all the stuff on old device gets wiped out

Any new and easy way to move all line chat logs/chats along with images from a previous device to a new device?
https://help.line.me/line/android/pc?lang=en

you can test this and let us all know if you're moving to a new device... copy the Android/data/jp.naver.line.android/storage/ folder to your computer for backup. activate LINE on new device, restore backup via Google Drive and then copy the Android/data/jp.naver.line.android/storage/ folder over to your new device. see if things populate then... that's the only thing I can think of since they removed the local backup option
 

desiregeek

Senior Member
Jun 27, 2010
644
33
you can test this and let us all know if you're moving to a new device... copy the Android/data/jp.naver.line.android/storage/ folder to your computer for backup. activate LINE on new device, restore backup via Google Drive and then copy the Android/data/jp.naver.line.android/storage/ folder over to your new device. see if things populate then... that's the only thing I can think of since they removed the local backup option
The backup file is only 567KB so the backup is obviously missing all the images. Whether it be from Smartphone or computer 567kb file should be the same
 

sga999

Senior Member
Mar 13, 2012
968
165
I have not tried backing up with this new Google Drive method and restoring to a different device. But on one device, if I do the backup, then restore, recent images and videos do get restored properly. I'm not sure if older ones "expired" or if there is some other reason for them to be missing.

Other than that, I do like backing it up all at once rather than one chat at a time. And I don't mind that it's backed up to Google Drive. But I don't see the file on my Google Drive. I must not understand where they are putting the backup file. I have one Line account through Facebook and another one with a phone number on a different device. It looks like both of those can be backed up and restored separately with no problem.

Also, Titanium Backup seems to work well. There are posts in this thread about using Titanium Backup restore, but after that, you had to jump through some hoops by using sqlite to get it to work. I didn't have to do that after this Titanium Backup restore. But again, I am just doing the restore on the same device. So moving to a different device might not work as well. Maybe someone else has tried this by now.

EDIT: I just did the transfer to a different device for the Line account through Facebook. It worked with no problems. I would guess that it is also that simple for an account with a phone number, email, and password.
 
Last edited:

sga999

Senior Member
Mar 13, 2012
968
165
A follow-up to what I wrote in that last post. It is possible that the images and videos persisted only because I already had them in Keep. I haven't done enough testing to prove this. But I didn't want to mislead about whether these files are actually transferred.
 

desiregeek

Senior Member
Jun 27, 2010
644
33
Line should have this worked out by themselves by now like all other chat apps. Should be easy and simple to do.
 

eeeemc

Senior Member
Jan 12, 2011
152
15
Hello ,
I get stuck during :
adb install -r -d c:\backup\line\line-old.apk

Error message:
Failure [INSTALL_FAILED_VERSION_DOWNGRADE]

Is anyone would share me older version LINE free talk I can try again .........................

Thank you very much.
edmond.
 

Zakowsky

Member
Oct 31, 2014
19
3
So this is infuriating; after trusting Line with 5 years of media rich chats and always being able to make a zip file and transfer them to a new phone I see the Google Drive system has nuked this in favor of Line getting access to your contacts, but Google won't let them use up too much cloud storage so you loose your images. Not that I am bitter...

I have been trying to solve this for days and found this thread; Line support has not been much help. My issue is I can't unlock the bootloader to root my source phone without wiping the phone in the process. And I can't root my new phone anyways, so Titanium and similar strategies will not work. I did learn that you can only make zip files with versions before 9.1.0, so I reverted Line on a test (non-essential) Line account/phone to 5.1.3 using Backuptrans and incrementally increased and tested compatibility between a 9.6.1 database (the data folder jp.naver.line.android) and older versions. It wasn't compatible with any versions earlier than 9.4.0, so you can't go back to pre-9.1.0 and use the zip file method.

I also tried decompiling the apk and changing the backup=false flag, but couldn't get it to recompile properly (with APK Easy Tool). Btw if anyone can do that, even though the signature would be off, it could solve the problem on unrooted phones.

But what did seem to work with the test account (running on 9.6.1) is to backup the Android/data/jp.naver.line.android folder to a PC, backup Line to Google Drive, then revert Line to 5.1.3 using Backuptrans, update Line to 9.4.0, then restore from Google Drive (so the chat comes back with no images), then delete the jp.naver.line.android directory and replace it with the original full version. So it is now reverted to 9.4.0 will all images in the chat.

But before I try this with the important account, I am thinking that maybe it worked because even though the Line app was basically deleted and so was the non-rooted jp.naver.line.android folder, maybe something was left in the root area that made it work.

So my plan is to backup the jp.naver.line.android directory on my old phone, take it offline, then install the same version of Line on the new phone, register it and transfer my account to the new phone as normal, restore from Google Drive, and then replace the new, image-less jp.naver.line.android folder with my backed up one with the images. Has anyone tried something like this and got it to work? Thanks.
 

musschrott

Member
May 13, 2009
43
6
I never tried it via Google, I assumed it wouldn't keep any references to images, as it obviously is not backing them up. Did you uninstall the app, after making the downgrade and backup? Normal uninstall should remove everything, via adb you can specify to keep data. Does the Google drive also restore group chats?

-----

I just finished to copy my Line data from my old S7 to a Zenfone 6 and after not liking it, also to a S10 without root needed. The backup part is roughly based on what I wrote here: https://xdaforums.com/android/help/howto-backup-transfer-line-to-phone-t3475438 and I hope I get around to rewrite it, the main points:

Using adb https://dl.google.com/android/repository/platform-tools-latest-windows.zip to downgrade the Line app (find an old line apk online, < 5.3):
adb shell pm uninstall -k jp.naver.line.android
adb reboot
adb install -r -d c:\backup\line\line-old.apk
(the reboot is needed on Android 7+ to get around INSTALL_FAILED_VERSION_DOWNGRADE error)

Making the actual backup:
adb backup -nocompress -f c:\backup\line\line.ab jp.naver.line.android
adb pull /sdcard/Android/data/jp.naver.line.android c:\backup\line\sdcard
(I had an issue with a compressed .ab file, so it's better to disable it)

Using https://github.com/nelenkov/android-backup-extractor the line.ab file can be converted to a .tar archive (java -jar abe.jar unpack c:\backup\line\line.ab c:\backup\line\line.tar). Before doing anything else I would recommend to do that. Extract the archive and check that inside the file is everything as it should be (folder: apps -> jp.naver.line.android -> db, ef, sp, f, r)

The harder part is using that backup, as it's no longer possible to change the android_id and Line uses that for some odd encryption, changing the actual db files is needed. The idea is to copy the settings from a new Line installation and merge it with the old content. As the end result is mostly based on the old data, I copied it (c:\backup\line) to a folder that represents the merged result: c:\backup\line_merged

I installed Line on my new phone (make sure to register password & email for your account https://help.line.me/line/ios/?contentId=20011522), logged into my account to trigger the transfer and then made a downgrade & backup from my new phone like above and extracted the .ab file (c:\backup\line_new\apps\...).

apps\jp.naver.line.android\db\naver_line is a SQLite DB and has the chats, as well as the setting table. The setting table from the old/merged db needs to be replaced with the setting table from the new db, the rest can stay as is. I used https://sqlitebrowser.org/ for that.
Open c:\backup\line_merged\app\jp.naver.line.android\db\naver_line (it has no .db ending, so it doesn't show by default, just change the filter), then attach (File -> Attach) the new phone db (c:\backup\line_new\app\jp.naver.line.android\db\naver_line). It will ask for a name, use newphone, which is used as reference name for SQL queries. Using the 'Execute SQL' window you can delete the table content and copy the data this way(without quotes): "DELETE FROM setting; INSERT INTO setting SELECT * FROM newphone.setting;" Write the changes to file (File -> )

Copy and replace the changed c:\backup\line_merged\app\jp.naver.line.android\db\naver_line file back into the .tar file (I'm using Total Commander for that, but I'm certain there are plenty of other tools). I also replaced the line_general_key_value* and e2ee* files within the db folder with those from the new phone export, to avoid letter sealing issues, but in hindsight I don't think it is necessary. In doubt you can disable and reenable letter sealing by going to the More > Settings > Privacy, which I needed to do anyways, as the desktop Line app forces to redo the letter sealing, if you change your phone.

Pack the .tar file back into a .ab file and put it back onto the new phone:
java -jar abe.jar pack c:\backup\line_merged\line.tar c:\backup\line_merged\line.ab
adb restore c:\backup\line_merged\line.ab

Restoring the files can be a bit tricky, I believe with Android 9 the pull/push behavior has changed. Up to Android 8 the pull command resulted in c:\backup\line\sdcard\jp.naver.line.android\ meanwhile in Android 9 there is no jp.naver.line.android folder. Uploading in 9 als creates a folder with the last folder name, meanwhile in 8 and lower this was ignored. If images are not working, this might be simply because the folder got placed into the wrong directory. The general upload command is:
adb push c:\backup\line_merged\sdcard /sdcard/Android/data/

You can use "adb shell ls /sdcard/Android/data/jp.naver.line.android" for directoy listings and "adb shell rm -r /sdcard/Android/data/jp.naver.line.android/sdcard" to delete.

If everything is in the right spot, after upgrading to the newest Line version everything (chats, group chats, sticker, pictures) should be in it's place. Profile images are stored only in cache, so they'll only appear after having an internet connection.
 
Last edited:
  • Like
Reactions: zentis and Zakowsky

Zakowsky

Member
Oct 31, 2014
19
3
Thanks for taking the time to document all this, much appreciated. Working with my test account I have made it up to browsing the SQLite database and all is going smoothly. Going to commit and transfer the account to the new phone and continue tomorrow. I found the key entry and it is listed as TEXT NOT NULL, but I will just swap that out when I get the db from the new account after transferring.. On the new phone I am going to install the same newer version that was on the old phone and then downgrade to the same as I did on the old phone. I haven't tested restoring the line.db on my set up, but as long as I downgrade it should be OK I figure. Thanks again and I will update on how it goes.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 23
    Skip to How to Import Chat History below to skip the background reading.

    Yes, there is a graphical import method for Line!

    If you use Line, and you want to change between devices, it seems as though it is nearly impossible to backup (export) and restore (import) your Line chat history. I have searched XDA, Google, AndroidForums, Line's (useless) online help, etc. No help, no info. There are some guides about how to use a SQL editor to fool the app, etc., but that was just way too much effort for me, so I finally gave up and just switched. BUT, before I did, I went ahead and exported all my chats, even knowing there was no way to import them, just in case. Well, that just paid off.

    There is absolutely no method available within Line to restore your chat history, right?! WHY is there a backup option? There MUST be a way! Seemingly no.

    I just figured it out. And when I explain it, you too will wonder, why in the !#$%@^$@%!#@$!#$@^*%^&(*%^@# has Naver not published this?????

    I was on my way to back everything up in preparation for a new ROM and figured I'd do a complete and total system wipe, meaning, I went to take a look at my internal storage (SDcard, Emulated, 0, whatever you refer to it as), to ensure that I got all the little things I want, like Viber pictures, WhatsApp pics, etc. And there I saw it. The folder. And, like you are now thinking, I thought, just maybe...

    How to Import Chat History (Abbreviated, Quick and Easy)

    Copy your chatHistory.zip file to internal storage sdcard/LINE_Backup
    Start Line, open an existing chat or start a new chat with the person whose chat history you want to restore
    Tap the drop-down arrow in the upper right, Chat Settings, and look what just showed up below the (formerly) useless Backup Chat History option

    How to Backup and Restore Chat History (Additional Details)

    Line offers a "Backup Chat History" option, but keep in mind, this is conversation / per-person specific. That means, you need to do it for each individual person.

    For my own ease of use, and to make transferring things easy, now that I know what the process is, here's what I did.

    Backing Up

    Go into the conversation you want to backup.
    Tap the drop-down arrow in the upper right, and select Chat Settings.
    Select Backup Chat History, Backup All
    Say Yes to e-mail this chat - in a previous version, I had to enter the conversation person's name in the subject, the new Line now does this for me.
    Repeat this process for every conversation you want to migrate to a new device.

    Restoring

    On your new device, save the attachments from each e-mail into the /InternalSDCard/LINE_Backup/ directory.
    Start Line, go to Chats, Tap the Chat Bubble in the upper right to start a new conversation, select the person you want to restore
    Your chat window will be empty, but from here, you just follow the instructions above, basically, drop-down arrow, Chat Settings, Import Chat History

    And that's it.

    I REALLY hope this helps some people out. I wasted a LOT of time trying to figure this out, and as usual, once you know the solution, it's pretty simple and seems so obvious.

    If I helped, throw me some Thanks button so I know I wasn't the only one!
    19
    I just found a method for importing the chat history using Titanium Backup and the terminal. You need root for this. Recently Line made some changes that made this more
    Hope you find this useful.

    1. Restore Line with Titanium Backup (app+data) (DON'T OPEN THE LINE APP YET!)

    2. Log into a root shell and delete the previous settings:

    sqlite3 /data/data/jp.naver.line.android/databases/naver_line
    delete from setting;
    .quit


    3. Now we have to delete this xml only if you are using a recent version. In previous ones it didn't even exist as far as I know
    rm /data/data/jp.naver.line.android/jp.naver.line.android.settings.xml

    4. Open the Line app and it will ask you to enter your user and password.
    You will receive a warning about losing your chat history. Just ignore it and...

    5. Enjoy!
    10
    This gives me this error:
    Error: unable to open database "data/data/jp.naver.line.android/databases/naver_line": unable to open database file
    I use the emulator in ROM Toolbox Lite
    Got it! I was missing the su command to make the emulator rooted.
    I also found the jp.naver.line.android.settings.xml file in a slightly different location than where daimyorl said above (but the credits go to him). For me it was into /data/data/jp.naver.line.android/shared_prefs/

    Then, the complete instructions that worked for me are:

    1. Restore Line with Titanium Backup (app+data) (DON'T OPEN THE LINE APP YET!)
    2. Log into a shell and delete the settings:
      Code:
      su
      sqlite3 /data/data/jp.naver.line.android/databases/naver_line
      delete from setting;
      .quit
    3. Remove jp.naver.line.android.settings.xml
      Code:
      rm /data/data/jp.naver.line.android/shared_prefs/jp.naver.line.android.settings.xml
    4. Open the Line app and it will ask you to enter your user and password. It will also ask your phone number for the confirmation SMS.
    5. Enjoy!
    3
    Hello there!

    As per my usual routine, whenever I find myself doing a full wipe on my Android device, I always make sure to come back here and consult the steps and recommendations shared to avoid those annoying limitations when it comes to restoring the LINE app without a proper backup system. Seriously, it's quite frustrating how they make it so complicated!

    But hey, I've got some great news to share with you. In the past, I used to rely on the outdated Titanium Backup, but it's difficult to make it work for most of the apps nowadays so I switched to this app called Swift Backup. And the good news is, with the proper configuration, Swift Backup seems to be capable of restoring LINE as well.

    How to do it? It appears that if you check the box labeled "Restore app SSAIDs" in Swift Backup, LINE opens up without any additional hassle. This nifty feature restores the app's original ID. Although I personally believe it may not be necessary, just to be on the safe side, I recommend activating this option when creating the backup, not just during the restoration process. Oh, and one more thing, after restoring LINE, it's essential to restart your device; otherwise, you might encounter some troublesome issues.

    Initially, when I tapped on the LINE icon, nothing happened. You know, that all-too-familiar symptom where the app detects that you're using a different device. Even after restarting, the app still refused to open. However, I stumbled upon a little trick that did the trick for me: I uninstalled the app and then restored it again. Voilà! That did the trick, and I was able to use LINE without any additional fuss. Hence, I wholeheartedly recommend considering Swift Backup for your backup needs. While there may be other apps out there with similar functionalities, I haven't come across them just yet. If you happen to know any, I'd be delighted to hear your recommendations. All I can say is that Swift Backup works like a charm and can save you from the laborious steps that this amazing community has managed to decipher. Of course, if a direct restoration method exists, all the better!

    To sum it up, here's a quick rundown of the steps to restore LINE, as I mentioned based on my personal experience:

    1. Opt for Swift Backup or other backup app with SSAID restoring capabilities
    2. When you restore LINE using Swift Backup, make sure to turn on the "Restore app SSAIDs" option. I think It's not required, but it's a good idea to enable this option when you're creating the backup, not just when you're restoring it.
    3. Once the restoration is complete, it's crucial to restart your device. Trust me, this step is vital; otherwise, LINE may not open.
    4. After restarting your device just opening the LINE app should do the trick and you could continue using LINE in your new device (actually I think that probably could let you keep using LINE in 2 different devices)
    5. If the LINE app still won't open uninstall the app and restore the backup once again (actually most of the time I had to uninstall before I could make it work).

    Please bear in mind that these steps might vary depending on the specific device and software versions you're using. If you happen to stumble upon any additional tips or alternative methods, feel free to share them with the wonderful folks in this forum.

    I sincerely hope this information assists you in restoring LINE after a full wipe without causing you unnecessary stress.
    Best of luck!
    3
    Just my 2c... This method if backup/restore sucks... not because of the OP, but because LINE doesn't have a batch backup/restore option!!! Have hundreds of conversations that I'd like to maintain... which means, hundreds of times of clicking backup etc etc, the hundreds of times clicking restore etc etc.

    FYI, if you are willing to root your phone and pay for TIBackup Pro you can simplify the process. Backup LINE (user apps) and your SETTINGS (system apps) with TIBackup. Copy TIBackup folder to external sdcard or PC. Do whatever you were going to do that required you to backup/restore LINE. Load up TIBackup, load up the TIBackup folder, restore LINE APP+DATA, then goto the menu in TIBackup and scroll to the bottom and select 'manage android id' and select restore from backup (if you backed up the correct settings data under system data there will only be ONE option). Your phone will automatically reboot. Click on LINE, boom everything just like it was before.