Open kalaschnik opened 4 years ago
We cover this kind of automation with Raft WSL. But if you replicate what Raft does it will suit your needs. The trick is to restore exactly in the same directory where your distribution was previously installed.
For example: %USERPROFILE%\AppData\Local\Packages\WhitewaterFoundryLtd.Co.16571368D6CFF_kd1vv0z0vy70w\LocalState
Also, use the same name:
wsl --import WLinux %USERPROFILE%\AppData\Local\Packages\WhitewaterFoundryLtd.Co.16571368D6CFF_kd1vv0z0vy70w\LocalState C:\some\backup\location\pengwin.tar
It will complain that there is another distro there so you need to "unregister" the old one first.
I am not sure if the path "%USERPROFILE%\AppData\Local\Packages\WhitewaterFoundryLtd.Co.16571368D6CFF_kd1vv0z0vy70w\LocalState" id correct in every environment do check it.
And tell me how it is going.
After that you need to set your default user:
pengwin.exe config --default-user <username>
Regards
That’s a good guide. I was note aware to just use the old location. I’ll try it later and post my results! Thanks Carlos!
Interestingly I had the same number string "hash", but unfortunately the import fails after some time of computing :/
wsl --import WLinux %USERPROFILE%\AppData\Local\Packages\WhitewaterFoundryLtd.Co.16571368D6CFF_kd1vv0z0vy70w\LocalState C:\Users\steven\OneDrive\.config\pengwin-images\2020-03-30\WLinux.tar
The specified network name is no longer available.
Replace %USERPROFILE% by its value: echo %USERPROFILE% in cmd
And try not using onedrive. If it fails, copy the tar outside OneDrive folder
I rather suspect that it’s a global WSL issue https://github.com/microsoft/WSL/issues/4835
Try to import it in WSL2 or WSL1 I mean a different version. Then if it works you can migrate
import with --version 1 is running since an hour... the tar is 10 gb... let see......
After couple of hours later it worked, also the RAM is not skyrocketing to 95%... However the command line cannot detect my files in home if I do ls
or ls -a
. It is empty (except of winhome). However, if I check within explorer everything is there...
My command line is also in root mode:
root@SilverSpringRat:/home/steven#
Any idea how to fix the problems?
Btw, I did the following steps
wsl --import WLinux %LOCALAPPDATA%\Packages\WhitewaterFoundryLtd.Co.16571368D6CFF_kd1vv0z0vy70w\LocalState C:\Path\To\WLinux.tar --version 1
Remark: %LOCALAPPDATA%
was not a problem, neither was OneDrive.
After importing I was able to successfully convert to WSL 2 using
wsl --set-version WLinux 2
pengwin.exe config --default-user <username>
Thanks this also made my files re-appear in Linux ... well thats a heck of a workaround for a backup...
Let's try to put it together into a How-To
What is the recommended way of doing backups and restore the current Pengwin (or any distro) state.
I know there is wsl --export and --import; however, let’s say you import the distro like so:
--import PengwinCustom C:\pengwin C:\some\backup\location\pengwin.tar
With this approach the pengwin distro would not receive updates from the Store anymore. Moreover, I seems I have to re-create the user account on a new machine...
Is something that works more out of the box? Or should I actually dive into modern dotfile management?