4

I am in the process of upgrading an instance of SilverStripe 3.6.5 to SS 4.x and I have been following the recommendations to install the SilverStripe upgrader.

But running composer global require silverstripe/upgrader on my Windows development box yields this:

Using version ^1.4 for silverstripe/upgrader
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
  - Installing silverstripe/upgrader (1.4.1): Downloading (100%)
    Failed to download silverstripe/upgrader from dist: There was an error extracting the ZIP file, it is either corrupted or using an invalid format.
    Now trying to download from source
  - Installing silverstripe/upgrader (1.4.1): Cloning 84226286c8 from cache

Installation failed, reverting ./composer.json to its original content.

I am using this stack:

  • Windows 8.1
  • PHP 7.1.26
  • composer 1.8.5
  • git version 2.21.0.windows.1

I have no Composer package in the global scope at this moment.

What I have also tried (to no avail) is to uninstall composer, clear all caches and folders, and start afresh with downloading Composer-Setup.exe again and right after its installation is finished, try again composer global require silverstripe/upgrader on the command line. The results were identical as to silverstripe/upgrader even though all other packages (I guess its dependencies) downloaded and installed fine. For instance, this is an excerpt of the command line output after starting afresh:

Changed current directory to C:/Users/Amenel/AppData/Roaming/Composer
Using version ^1.4 for silverstripe/upgrader
./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 35 installs, 0 updates, 0 removals
  - Installing ocramius/package-versions (1.4.0): Downloading (100%)
  - Installing composer/ca-bundle (1.1.4): Downloading (100%)
  - Installing padraic/humbug_get_contents (1.1.2): Downloading (100%)
  - Installing padraic/phar-updater (v1.0.6): Downloading (100%)
  - Installing symfony/polyfill-ctype (v1.11.0): Downloading (100%)
  - Installing symfony/filesystem (v4.3.1): Downloading (100%)
...

I can't seem to find anything related to this specific error when I perform a web search on it.

Also worthy of note: this error is also reported when I specify a previous version of silverstripe/upgrader, e.g. 1.3.0.

To sum up, my problem is that I can't start the upgrade process because the installation of the upgrader via composer fails.

AbVog
  • 1,435
  • 22
  • 35

1 Answers1

1

This is how I circumvented this issue.

My goal is to run the upgrader. The path to that as the documentation says is to use Composer when on Windows. But the path via Composer appears to be blocked. I asked myself what were the options. Reinstalling an entire stack in a virtual machine is possible, but tedious. I kept thinking, but nothing felt appealing.

I ended up downloading the phar file to D:\Programs\SilverStripe-upgrader and I renamed it to upgrade-code-1.4.1.phar. Given that D:\Programs is already in my PATH envvar, I have created a file D:\Programs\upgrade-code.bat with the following contents:

@ECHO OFF
php %~dp0\SilverStripe-upgrader\upgrade-code-1.4.1.phar %*

I haven't run the migration yet, but upgrade-code help works fine. HTH.

AbVog
  • 1,435
  • 22
  • 35