I have several hundred sites on my Local which I’m no longer able to access, as my sites.json is now blank.
How it happened: I was importing a large site, and ran out of disk space (this is on Ubuntu). I got a generic crash message, emptied my trash, and upon my second attempt, I couldn’t get Local to open. I then realized my sites.json was fully blank (0kb). I had to delete the blank file, upon which Local regenerated it and I was able to open Local, albeit with no sites listed.
All of the sites still exist in my Local directory.
My question: is there a way to regenerate sites.json somehow?
It seems that much of the data still exists in ~/.config/Local/run
– the project IDs, the project path, and some of the service port numbers and service versions. I thought to write a bash script that will iterate through the folders in /run and generate a new sites.json. I was able to get as far as getting my sites back in local, but they wouldn’t actually start. I don’t have much knowledge as to how all of the architecture works – maybe my strategy isn’t plausible.
Possibly adding to the complexity is that, in the meantime, I’ve needed to manually import some sites I’m working on. I notice that the new sites.json has ports starting at 10000, which I gather is the starting point. I imagine this might cause conflicts with the original first few sites that I had in Local, that I still hope to recover.
Any advice/insight would be appreciated.