Pengwin icon indicating copy to clipboard operation
Pengwin copied to clipboard

Proper way to backup/restore Pengwin

Open kalaschnik opened this issue 5 years ago • 12 comments

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?

kalaschnik avatar Mar 30 '20 12:03 kalaschnik

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

crramirez avatar Mar 30 '20 13:03 crramirez

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!

kalaschnik avatar Mar 30 '20 13:03 kalaschnik

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.

kalaschnik avatar Mar 30 '20 22:03 kalaschnik

Replace %USERPROFILE% by its value: echo %USERPROFILE% in cmd

crramirez avatar Mar 30 '20 22:03 crramirez

And try not using onedrive. If it fails, copy the tar outside OneDrive folder

crramirez avatar Mar 30 '20 22:03 crramirez

I rather suspect that it’s a global WSL issue https://github.com/microsoft/WSL/issues/4835

kalaschnik avatar Mar 30 '20 22:03 kalaschnik

Try to import it in WSL2 or WSL1 I mean a different version. Then if it works you can migrate

crramirez avatar Mar 30 '20 22:03 crramirez

import with --version 1 is running since an hour... the tar is 10 gb... let see......

kalaschnik avatar Mar 30 '20 23:03 kalaschnik

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

kalaschnik avatar Mar 31 '20 09:03 kalaschnik

pengwin.exe config --default-user <username>

crramirez avatar Mar 31 '20 10:03 crramirez

Thanks this also made my files re-appear in Linux ... well thats a heck of a workaround for a backup...

kalaschnik avatar Mar 31 '20 10:03 kalaschnik

Let's try to put it together into a How-To

crramirez avatar Mar 31 '20 10:03 crramirez