Migrate Bash on Windows to Store app Creators Update
As Ramhound mentioned, MS officially suggested migrating files to the new store-delivered instance (I guess the legary lxrun-installed instance will never receive 18.04 LTS or any later version). I have yet to do the migration, but I think the reasonable way of moving into new instance is like this:
Start sshd on the old instance:
sudo /usr/sbin/sshd -D
Run scp from the new instance:
scp -r localhost:~/* /tmp/
- this will keep your file modes, while copying to a Windows filesystem will destroy them (setting everything to 0777)Replace, with
sudo
, the directory tree in the new instance with what you just copied.
Be sure that nothing is running in the background of WSL if you're going to replace system directories. You will need to copy /bin, /etc, /home, /opt, /sbin, /usr, and /var if you want a full recovery, but only doing /home
, /opt
, and /usr/local
(which contains libraries installed or compiled manually) and install repository packages again with apt
might be a safer option.