Where does Atom store project metadata?


#1

How does Atom remember projects, where does it store the data?

I copied git cloned my .atom folder to a new computer. The computer has the same folders existing in my home folder as on the other computer. Atom no longer sees my projects.

So when I use something like project-plus package, I don’t see a convenient list of the projects I’ve opened in the past.

Where is this information stored, so I can transfer it over?


#2

Atom stores state memory in LocalStorage. This isn’t intended to be especially permanent, which is why it’s important to not keep unsaved files lingering around.

Your clone command should have copied .atom/projects.cson, which is the file that project-plus uses to remember what projects you have.


#3

Ah okay. I’m not manually saving projects (so they aren’t being placed in projects.cson which is empty). I’m relying on the default auto-detected projects, which I like because I don’t have to do anything, and they are named by their folder name.


#4

You’re engaging in risky behavior. project-plus autodetects projects based on info stored in Atom from previous sessions, which will be erased if you ever change computers, delete and reinstall Atom, or use the --clear-window-state switch to reset a display error. You should not leave information you rely on in RAM, and the data persistence from session to session should be considered an extension on the capabilities of the RAM, not a data storage technique. If you have an unsaved file open in Atom, that file needs to get saved as soon as you decide where it should go. The same goes if you have a project that project-plus has implicitly detected: you need to permanently record that. If you don’t, it’s only a matter of time before something happens and you have to rebuild from scratch.


#5

But one thing is for sure, the places where my projects live in the filesystem is the same across machines, so I see no harm in grabbing project data and taking it to another machine if it is possible. Is it possible to add to the auto-detected projects with some API call?


#6

In that case, you’ll have to put the project data somewhere you can grab it. You should not be porting the Atom state data directly for the same reason that you shouldn’t move RAM pages directly from one computer to another even if it’s technically possible. Active memory contains useful file data mixed with highly specific information about the hardware and how to handle what’s in memory, and it changes all the time without warning. It may at any point disappear entirely, and if you’re syncing with something that’s only meant to be reliable for the duration of specific tasks, then you run the risk of losing everything you were relying on. You want to commit the information to a form that all computers agree on and isn’t going to go away unless instructed to do so: a file.

Is it possible to add to the auto-detected projects with some API call?

If it is, the package author has not documented it.