Hi all,

As below is quite a complete manual, that can put in a book, I reply to this message to add 2 more things to this chapter:

Security:
User passwords in an old version of Pier have a different method of hashing then in the newer version. So when converting it might be possible you loose your password. In order to be able to login again, you need either to modify the code the code exporter makes and put a new password hash in. The hash can be created by evaluating the following command:
GRPlatform current secureHashFor: ‘<your password>’,
or you modify the password of the administer after you make the import by performing:
(PierKernel named: ‘pier’) adminUser password: ‘<your password>'

Updater
To make life easier to deploy, there is also an auto updater. This updater needs to be loaded after you load the exported code. Currently the package name is not configurable. It expects the package: ‘Pier-Exported-Code’ and if it can update this package, it installs it into seaside and when a newer version is available it refreshes this install.

The following code can be used to install a production version, that only has a Pier (and files) without any development tools:
Gofer new 
smalltalkhubUser: 'Pier'
project: 'Pier3Addons';
configurationOf: 'Pier3AddOns';
load.

((Smalltalk at: #ConfigurationOfPier3AddOns) project version: #'development') load: 'Pier-Exporter-Code'.

(Smalltalk at: #WAAdmin) clearAll.
(Smalltalk at: #WAAdmin) defaultDispatcher  
register: (Smalltalk at: #WAFileHandler) default
at: 'files'.
(Smalltalk at: #WAAdmin) disableDevelopmentTools.

Gofer new
directory: <the local server directory as string where the exported code is stored>;
package: 'Pier-Exported-Code';
load.
Gofer new 
smalltalkhubUser: 'Pier'
project: 'Pier3Addons';
package: 'Pier-Updater';
load.

(Smalltalk at: #WAAdmin) defaultDispatcher defaultName:'pier'.
(Smalltalk at: #ZnZincServerAdaptor) startOn: 8080.

Cheers,
Diego

On 04 Feb 2014, at 11:51, Diego Lont <diego.lont@delware.nl> wrote:

Hi all,

Load script below still should be made nicer (using the ConfigurationOfPier3Addons), but for now this gives a reasonable result. There are a few notes:
- you should not forget to copy the files. Preferable before creating the Pier instance.
- there are still some does not understands in Citizen, because there are no accessors to build this tree. If someone can give me rights to this, I will add the accessors needed.
- pier3 requires {{{ }}} to embed html. This is not converted, and gives some flaky results.
- testing the site, shows that some parts do not work yet, because some of the used components do not work in Pier3.

Export script:
" Load exporter code "
Gofer new
package: 'Pier-Exporter-Code';
load.

" Check the kernel name, for moose-technology this was the default (pier) "
(Smalltalk at: #PRKernelCodeExporter) exportAsPier3Kernel: 'pier'.

self doStuffInComment.
" Save exported code with Monticello "

Import script: (tested in a fresh pharo 2.0, tailored to work for the moose-technology website, as it loads the used packages for this website.)
" Load Pier"
Gofer new
package: 'ConfigurationOfPier3';
load.

(Smalltalk at: #ConfigurationOfPier3) load.

" Load things we need for some of the extensions "
Gofer new
package: 'ConfigurationOfFame';
load.

((Smalltalk at: #ConfigurationOfFame) project version: '1.2') load: 'Core'.

Gofer new
package: 'ConfigurationOfRoassal';
load.

(Smalltalk at: #ConfigurationOfRoassal) project latestVersion load.

Gofer new
package: 'ConfigurationOfCitezen';
load.
((Smalltalk at: #ConfigurationOfCitezen) version: '2.1') load: 'Web'.

" Load Pier extensions "
Gofer new
package: 'Pier-Blog';
package: 'Pier-Documents';
package: 'Pier-Exporter-Code';
package: 'Pier-JQuery';
package: 'Pier-Google';
package: 'Pier-Fame';
package: 'TopFeeder-Pier-Widgets';
package: 'Pier-Randomizer';
load.

self doStuffInComment.
" manually do the following things 
- load exported code
- roll back Magritte-Exernal-FileModel to version 'Magritte-Pharo-Model-DiegoLont.27'
- Copy the folder '/files' to the (resource folder of the) new image or configure Magritte-External-FileModel to point to the right place.
"

" remove old occurrences: "
PRKernel reset.
" and load and register the new one: "
PRKernelCreatorForPier register

Diego