-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Safely relocate existing scoop installation directory? #3852
Comments
You should be able to use symbolic links to make this job easier. |
Just tried with both symlink and junction, although things like git, gcc, nodejs, go, java and mobaxterm seem to work without issues, there are already two deal breaker problems I have encountered. The first is that archwsl completely breaks, and about one third of my development works depend on the Archlinux WSL environment. Even after a complete uninstall and reinstallation, the archwsl just won't start. The second one is that VScode's code formatter and auto-complete functionalities break, not the standard html and javascript formatters nor the third party formatters installed with go and python extension work. Always says "No formatter installed" (Curiously, the Atom code formatters still work) Not sure if there will be more deal breaker issues waiting to be discovered with this symlinking/junctioning approach, guess I'll have to take the original plan to try reinstall scoop to the new drive and copy everything there (then modify some environment variables and re-register some services I guess). |
today i move scoop to another disk successfully. you should do the follow things: |
I have done my moving using this suggested solution, and it works nicely so far. I'd like to add a few steps/precautions:
There may or may not be some apps that need some manual tweaking, eg I've found:
I ended up re-scanning whole registry with Anyway, messing with registry you need to beware what you're doing, I'm just saying some apps seem to have registry paths, which may or may not get updated on next app update. Since I've changed few services, I've also done a full PC reboot, and then another Main apps I care about to stay "intact" (Chrome and Notepad++ with kazillion tabs) still work fine after this procedure. |
One little thing to add up if you don't want to set the You will need to use this command to update the root path: scoop config root_path X:\path\to\scoop For my case it's: scoop config root_path D:\scoop Or else you will still get a bunch of old path in the std out when you run |
Just an extra problem I faced. I had pwsh installed with scoop so scoop itself wouldn't run giving me a pwsh not found because its shim was not updated. I opened the scoop shim (D:\scoop\shims\scoop in my case) in notepad and after updating the paths had this:
Because pwsh was installed the first line ran but was giving me a PWSH error (looking in the wrong place) so I just copied the else line into a command line and reset the tool with:
after which, scoop itself was fixed and so was everything else. |
#3852 (comment) worked for me and I used following script to update the environment variables (execute only if you understand what it does) # CHANGE THIS
$originalValue = 'c:\users\me\scoop'
$newValue = 'd:\me\scoop'
# Get the current user environment variables
$userEnv = [System.Environment]::GetEnvironmentVariables('User')
# Get the system environment variables
$systemEnv = [System.Environment]::GetEnvironmentVariables('Machine')
# Update the user environment variables
$userKeys = $userEnv.Keys | ForEach-Object { $_ }
foreach ($key in $userKeys) {
$value = $userEnv[$key]
if ($value -is [string]) {
$updatedValue = $value -replace [regex]::Escape($originalValue), $newValue
if ($updatedValue -ne $value) {
[System.Environment]::SetEnvironmentVariable($key, $updatedValue, 'User')
Write-Output "Updated user variable: $key"
}
}
}
# Update the system environment variables
$systemKeys = $systemEnv.Keys | ForEach-Object { $_ }
foreach ($key in $systemKeys) {
$value = $systemEnv[$key]
if ($value -is [string]) {
$updatedValue = $value -replace [regex]::Escape($originalValue), $newValue
if ($updatedValue -ne $value) {
[System.Environment]::SetEnvironmentVariable($key, $updatedValue, 'Machine')
Write-Output "Updated system variable: $key"
}
}
} |
Before run the scoop installer script, create a symlink to point to where you want scoop to be installed to : |
Currently my system drive is running low on space, and as the scoop directory is taking up more than 30G space, I'm thinking of moving it to a new SSD (drive E) that I just added. I wonder if the following steps are safe and enough to accomplish this:
scoop uninstall scoop
scoop reset *
I wonder if the above steps will be safe and enough to do a scoop installation directory relocation? Anything else to watch out for? Since currently my whole development environment is managed by scoop including databases and various IDEs, I'd rather not mess any of them up that'd take days to recover the data and settings, etc.
Thanks.
The text was updated successfully, but these errors were encountered: