Pier 2.0 to Pier 3.0

The steps for the upgrade were:

  1. From the Pier 2 image, load the latest Pier-SW2-Sw1Features from this repository
  2. Modify the Pier 2 image based on the concerns below - Ran the Pier2ToPier3Converter converter code in the class comment
  3. Nick Ager gave a No Kernel left behind presentation recently, it provides a way to upgrade to writing out a wiki in Smalltalk code. The code depends on FileSystem code (see Deep into Pharo).
    • I used Pier-Exporter-Code 67 (version 68 uses aDescription stringAccessor canWrite:..., which was not available in older Pier2 images, 67 uses aDescription accessor canWrite:... instead).
    • The first attempt was unsuccessful because of too many literals in a single method (more than 256 literals referenced in a single method) - reduced the number of users from 130 down to 120
  4. If the class PRKernelCreatorForPier exists, remove it
  5. Executed in a workspace: PRKernelCodeExporter exportAsPier3Kernel: 'pier'
  6. Fileout the Pier-Exported-Code package
  7. Update the text file with a few cleanups:

    Replace extra braces with literal html:

    %s/>}}}\([ a-zA-Z0-9]*\){{{</\>\1\</g

    Format tables better - Replace

    |""... 

    with

    |!

    Updates:

    %s/\([^a-zA-Z0-9_" <>,!;:*&()|.'\/=-]|\)[ ]*""\([a-zA-Z][a-zA-Z0-9\/ -]*[ ]*\)""[ ]*|[ ]*""\([a-zA-Z][a-zA-Z0-9\/ -]*\)[ ]*""[ ]*|[ ]*""\([a-zA-Z][a-zA-Z0-9\/ -]*\)[ ]*""[ ]*|[ ]*""\([a-zA-Z][a-zA-Z0-9\/ -]*\)[ ]*""[ ]*|[ ]*""\([a-zA-Z][a-zA-Z0-9\/ -]*\)[ ]*""[ ]*|[ ]*""\([a-zA-Z][a-zA-Z0-9\/ -]*\)[ ]*""[ ]*|[ ]*""\([a-zA-Z][a-zA-Z0-9\/ -]*\)[ ]*""[ ]*\([^a-zA-Z0-9_" <>,!;:*&()|.'\/ =-]|\)/\1!!\2 |!!\3 |!!\4 |!!\5 |!!\6 |!!\7 |!!\8\9/g
    	
    %s/\([^a-zA-Z0-9_" <>,!;:*&()|.'\/=-]|\)[ ]*""\([a-zA-Z][a-zA-Z0-9\/ -]*[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 |!!\3\4/g
    
    %s/\([^a-zA-Z0-9_" <>,!;:*&()|.'\/=-]|\)[ ]*""\([a-zA-Z][a-zA-Z0-9\/ -]*[ ]*\)""[ ]*\([^a-zA-Z0-9_" <>,!;:*&()|.'\/ =-]|\)/\1!!\2\3/g
  8. Filein the code to the Pier 3 image
  9. Backup the original kernel: PRKernel instances size = 1 ifTrue: [ PRKernel instances anyOne name: 'original']
  10. Re-create the kernel with PRKernelCreatorForPier new createKernel
  11. From the configuration page select the new kernel instead of original
  12. Created /system with a UI Distribution, go to root/Settings, set:
    Template: /system/templates/environment
    Style Sheet: /system/components/defaultCss
  13. Reset the password for all users (there is a different algorithm, so this information is lost):
    (PRKernel instances detect: [:e | e name = 'Pier']) users do: [ :e | e password: 'password' ]. 
  14. Importing History
  15. Disable the dev tools - these appear on the bottom of each page as:
     New Session  Configure  Halos  Profile  Memory  XHTML
    From seaside deployment, run: WAAdmin applicationDefaults removeParent: WADevelopmentConfiguration instance.
    This may require reloading the page, or going into configuration and replacing the cache. If it is unsuccessful, try re-moving Application-defaults from the configuration page (one can re-add this later)
  16. Previous static content that was saved in the image (such as images that were saved as: +picture.png+) were missing their file links. These were converted to img tags, and saved on a file sharing site (see this blog).

Version Differences

There are several changes between Pier 2 and Pier 3:

  • For lines of pre-formatted text, there must be a space after the equal sign - this is OK:

    = text

    This will not be pre-formatted:

    =text

  • Page names are also more strict, such as spaces in the names are not allowed
  • Certain characters also cause issues when one tries to edit those pages. These generally being with Character value: 226