Sublime Forum

I just updated Sublime Text and lost all my unsaved files

#1

I had bunch of stuff I was storing inside Sublime Text without saving (dumb move, I know).

The files would stay inside Sublime Text even when rebooting my computer.

Then today I updated Sublime Text from 3207 to 3211 and I lost all of those unsaved files.

I REALLY need them back.

Searching around I found this guy from 2018 who had a similar problem when updating from Sublime Text 2 to Sublime Text 3.

He was bale to restore all his work by copying the old session file to the new location.

My problem is that I canā€™t find the old sessions file. Where would I find that?

I looked in the recycle bin but it only had the installation files for build 3207, not the sessions file.

Can someone please help me recover these files?

I really need them back!

2 Likes

#2

If youā€™re using Windows, your session files should be here: C:\Users[your computer name]\AppData\Roaming\Sublime Text 3\Local. Iā€™m not as familiar with Macs, but I would assume itā€™s in your library somewhere.

0 Likes

#3

On Macs itā€™s in your home directory: Libraryā© ā–ø āØApplication Supportā© ā–ø āØSublime Text 3 ā–ø āØLocal

0 Likes

#4

I had this happen as well and Iā€™m on portable version. Anyone know where it might possibly be stored if using portable? I always used portable and it was never an issue until the latest update.

0 Likes

#5

The portable version of Sublime has a directory in it named Data, and inside of there will be things like your Packages folder and such. The Local directory inside of there is where the session file is stored.

0 Likes

#6

I was confused and started trying to restore my open files from the menu overwriting this file.

This really, really is unfortunate yā€™all and you really shouldnt teach users they can store things like this and wipe it all in an update, or at least message it

0 Likes

#7

Weā€™re not quite sure whatā€™s causing this issue, but itā€™s clear that a fair number of people are affected. Weā€™ve put some mitigations in place for future versions to hopefully prevent this from happening again. Future versions will also make backups of session files before completing an update in the event that this hasnā€™t been fixed.

2 Likes

#8

I have just updated to ST4 and then again I lost everything. This is the third time this is happening to me and I think i just will never update ST again.
ST is fast so I use it to scrap dev codes, instructions and things that I donā€™t need to save since they will always be there when I launch it.

I am sorry to say but I donā€™t know how the unsaved filles are stored but it is a mess if I loose everything including open modified files are lost when it restart and start on a clean state with zero tabs.

0 Likes

#9

Depending on the version youā€™ve upgraded from thereā€™s a backup of your session file in your data directory. Worst case you can restore from that. What version and OS did you upgrade from? Did it start in a completely clean slate or just the open files missing their content?

0 Likes

#10

I am on a windows 10. It started from a completely new state and no tabs of which I add more than 20 tabs before updating

0 Likes

#11

Do you perhaps have a folder in your %APPDATA% called Sublime Text as well as one called Sublime Text 3?

0 Likes

#12

I have only the Sublime Text 3 and no Sublime Text folder

0 Likes

#13

Your backup session should be in %APPDATA%/Sublime Text 3/Local/, not sure of the exact name but iirc it has backup in it. The Session.sublime_session is what contains all the data Sublime Text saves between restarts, including unsaved files. If you want to inspect their contents itā€™s all JSON.

0 Likes

#14

The same thing just happened to me. Very frustrating. I didnā€™t even know there was a Sublime Text 4 and wouldnā€™tā€™ve have even upgraded if the popup said it was going to upgrade me to something I need to pay more money for.

Iā€™m on Windows 10. It started up with no open docs, not my old session and all my unsaved docs are gone. I closed it after installing which Iā€™m guessing caused the old session file to be rewritten in the AppData\Roaming\Sublime Text 3 directory if it hadnā€™t been already because thatā€™s got nothing in it besides file history and was modified after the update.

This is terrible. Putting a harmless looking upgrade popup in front of me that takes away my licensed version and gives me some trial version I need to pay $70 for while erasing my session is unbelievable. I would have updated to Sublime Text 4 before today, now Iā€™m changing editor.

0 Likes

#15

The update itself, as well as the new version donā€™t behave any differently in relation to the session file. This seems to be a long standing issue with Sublime Text updating itself that we havenā€™t been able to reproduce or narrow down, so to prevent further data losses weā€™ve added the backup session. Have you checked the previous mentioned bugging steps?

0 Likes

#16

I donā€™t have any backup session file as far as I can tell. I donā€™t know what version I was on before, but Iā€™ve not ignored any previous update popups not that I remember when the last one was.

All I have is the %APPDATA%/Sublime Text 3/ directory and in Local thereā€™s just the Session.sublime_session file that was written since the update. If thatā€™s where the backup session file would be then I donā€™t have one. Thatā€™s the only relevant step I see above for data recovery.

EDIT: The version I was on before was from November 2020 if not newer since thatā€™s when this PC was built.

0 Likes

#17

As @SEGMatt said that file was overwritten and in it is ā€œlast_versionā€: 4107. There were no other backup file in that directory and the date modified is the current date when the sublime text was last opened. I think ST should always make a separate backup before any update which it does not and makes us start afresh after updates

0 Likes

#18

i have such issue as @SEGMatt descripted. itā€™s so terrible and frustrate. no one backup file is in %APPDATA%/Sublime Text 3/, only overwritten Session.sublime_session. T_T

0 Likes

#19

As before with this issue, Iā€™ve tried and failed to reproduce it numerous times. Iā€™m always seeing the session left alone as well as the backup being created:

Either this issue is extremely rare or thereā€™s something specific in peopleā€™s setup causing it.

0 Likes

#20

@bschaaf I can see your screenshot but that seems to be interesting to me. I just uninstalled the sublime text and installed a new one but I didnā€™t see any backup created Session.sublime_session.

Another question if we are using an unregistered sublime text does it create this scenario?

0 Likes