Pier Kernel Export Using Fuel

One of the Pier instances I had running at work ended up with a corrupt changes file, when opening a browser, any method code was jibberish. It was possible to import changes using Monticello, but not change sets. Also the timed persistence was failing. Using the code export (ie PRKernelCodeExporter exportAsPier3Kernel: 'Pier') brought up an emergency evaluator.

It seemed like a good idea to use the Pier Import/Export component, however this failed due to the ReferenceStream class being removed from Pharo 2.0, and being replaced by Fuel. Replacing it in the PRReferenceStreamExporterImporter may not be easy (since fuel seems to work best with files, while the interface expects streams); however using fuel directly is quite effective - for exporting from the corrupt image:

FLSerializer serialize: (PRKernel instances detect: [:e | e name = 'Pier']) toFileNamed: 'Pier.fuel'. 

Importing can be done with:

PRKernel instances add: (FLMaterializer materializeFromFileNamed: 'Pier.fuel').

Then from http://localhost:8080/config/pier, one can select the kernel. This method keeps the same passwords and history.

Posted by John Borden at 4 September 2014, 10:56 am link