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