Recover corrupted site data?

I’m experiencing the same problem as described in RESOLVED - LocalWP does not work, even after reinstalling, i.e. my LocalWP installation corrupted (following a computer crash) and Local WP is failing to start.

I’ve now moved directory C:\Users<username>\AppData\Roaming\Local (containing a sites.json file full of NUL characters - i.e. corrupt) aside, and now LocalWP starts ok but the site I’m developing has disappeared (and I don’t have a backup :frowning: ). I’m trying to recover my work by restoring the Local directory and hand-editing sites.json but now when I click ‘Start Site’ I get error “Uh-oh unable to start site … Can’t connect to MySQL server on ‘::1’ (10061)'”.

Any clues on how to get the database running, or maybe just get a dump of its data ?

Thanks,

Michael

Hey @moconnor

If your machine crashed it may be that some files were wiped, but it’s also possible they’ve just shifted. Have you been able to manually locate any site files on your machine with searching?

Otherwise if they aren’t backed up anywhere, your only option would be something like Time Machine if you’ve used that before.

For future work, it’s always a good idea to take frequent backups. We have a built in Cloud Backups feature, or you can take backups manually to move to your own external or cloud storage.

As far as your current issues, in order to refresh here and start with a clean slate could you give the below troubleshooting steps a try?

  • Export any sites that you have on Local and save them to a folder somewhere on your computer: Backup a Local Site - Local

  • Fully uninstall Local from your computer following the specific steps for your OS here: Uninstall Local - Local

  • Install the latest version of Local on this link: Releases - Local

  • Once installed, please restart the computer.

  • When the computer is restarted and turned on, close any applications that automatically run in the background (AntiVirus, Firewall, and other Developer applications included).

  • Check and see if the issue still persists. If so, please provide us with an updated log: Retrieve Local’s Log File - Local

Hi Nick, thanks for that. I’ve managed to partially recover my site by zipping up directory C:\Users<username>\Local Sites<sitename> and loading it into LocalWP as a new site, but it seems to be incomplete as it’s missing recent changes (made in the last month or so), however it’s still a lot better than nothing.

Another problem is that although the new site loads and runs, its wp-admin UI fails with error “Warning : Cannot modify header information - headers already sent by (output started at C:\Users<username>\Local Sites<newsite>\app\public\wp-content\mu-plugins\local-by-flywheel-live-link-helper.php:1) in C:\Users<username>\Local Sites<newsite>\app\public\wp-includes\pluggable.php on line 1435”, and so I’m unable to work on it. Any suggestions on how I might fix this, or am I going to have to re-create the new site from scratch (and cut-and-paste content from the working new site)?

  • now there’s a lesson I wish i didn’t have to learn the hard way :slightly_smiling_face:
1 Like

UPDATE: it seems the wp-admin problem I mentioned was caused by file local-by-flywheel-live-link-helper.php (as mentioned in the error message) which on inspection was found to be corrupt (full of NUL characters). I replaced it with another version of this file from a different site and now the wp-admin UI is working again.

So that just leaves the missing recent changes, I feel like I’m nearly back at square 1 :slightly_smiling_face:

1 Like

Thank you for the updates here @moconnor! I’m glad you were able to get pretty close at least. Now before you get too much further don’t forget to create a backup (or two) :wink: :green_heart: