oops, where's my site?
DESCRIPTION
How to install Plone add-ons and live to tell the taleTRANSCRIPT
![Page 1: Oops, where's my site?](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54b686e04a79598c308b457d/html5/thumbnails/1.jpg)
Oops, where's my site?How to install Plone add-onsand live to tell the tale
![Page 2: Oops, where's my site?](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54b686e04a79598c308b457d/html5/thumbnails/2.jpg)
Goals
• Know the procedure for installing most Plone add-ons
• Understand guidelines to prevent things from breaking
• Recognize some common ways installation fails and know how to recover
![Page 3: Oops, where's my site?](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54b686e04a79598c308b457d/html5/thumbnails/3.jpg)
Starting on the same page
![Page 4: Oops, where's my site?](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54b686e04a79598c308b457d/html5/thumbnails/4.jpg)
The flavors of Plone installers
(Available from plone.org)
Windows installerOnly option for Windows.
OS XFor Mac OS X. Doesn't require a C compiler.
Unified installerInstallation from source for all Unix-like systems (including OS X).Requires a C compiler to install.
Your own custom buildoutMost likely generated using ZopeSkel or based on a previous project.Provides the most flexibility.
![Page 5: Oops, where's my site?](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54b686e04a79598c308b457d/html5/thumbnails/5.jpg)
buildout root
The directory that contains the rest of the installation.
WindowsC:\Plone41
Unified installer/usr/local/Plone/zinstance or $HOME/zinstance
Custom buildoutWherever you put it
![Page 6: Oops, where's my site?](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54b686e04a79598c308b457d/html5/thumbnails/6.jpg)
instance script
Script used to start Plone:
bin/instance fg
Windows
C:\Plone41\bin\instance fg
OS X & Unified installer
${${buildout_root}}/bin/instance fg
or
${${buildout_root}}/bin/client1 fg
![Page 7: Oops, where's my site?](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54b686e04a79598c308b457d/html5/thumbnails/7.jpg)
First, do no harm
![Page 8: Oops, where's my site?](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54b686e04a79598c308b457d/html5/thumbnails/8.jpg)
multi-staged deployment
• Keep at least one copy of the site separate from the production copy, to testchanges.
• Keep all changes in version control (svn, git, etc.) so you can reproduce yourenvironment.
• Use buildout's extends to handle differences between environments.
![Page 9: Oops, where's my site?](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54b686e04a79598c308b457d/html5/thumbnails/9.jpg)
Aspeli's rule of deploymentCode & configuration flow from the development site to the production site; dataflows from the production site to the development site.
![Page 10: Oops, where's my site?](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54b686e04a79598c308b457d/html5/thumbnails/10.jpg)
Back up your data before you make changes!
1. Make sure your buildout configuration is under version control.
2. Back up the data:
$ bin/snapshotbackup
-- or --
$ bin/backup
(collective.recipe.backup is included in the Unified installer buildout.)
![Page 11: Oops, where's my site?](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54b686e04a79598c308b457d/html5/thumbnails/11.jpg)
Restoring from backup
1. Stop the instance
2. Use your version control system to revert to the old version of the buildout,and re-run it.
3. Restore the data:
$ bin/snapshotrestore-- or --$ bin/restore
4. Start the instance.
![Page 12: Oops, where's my site?](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54b686e04a79598c308b457d/html5/thumbnails/12.jpg)
The simplest backup
Copy the entire buildout.
![Page 13: Oops, where's my site?](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54b686e04a79598c308b457d/html5/thumbnails/13.jpg)
Preparing to install
![Page 14: Oops, where's my site?](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54b686e04a79598c308b457d/html5/thumbnails/14.jpg)
Finding add-ons
• Python Package Index (PyPI): http://pypi.python.org/pypi
• Plone.org products directory: http://plone.org/products
• Plone Open Comparison: http://plone.opencomparison.org
![Page 15: Oops, where's my site?](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54b686e04a79598c308b457d/html5/thumbnails/15.jpg)
Plone version compatibility
![Page 16: Oops, where's my site?](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54b686e04a79598c308b457d/html5/thumbnails/16.jpg)
Dependencies
Simplest way to tell what it depends on is actually installing. :(
Use the buildout.dumppickedversions extension:
[buildout]extensions = buildout.dumppickedversions
(Included in the Unified installer buildout.)
![Page 17: Oops, where's my site?](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54b686e04a79598c308b457d/html5/thumbnails/17.jpg)
What does it do?
• Does it do some trivial customization, or introduce a brand newexperimental subsystem?
• Does it do anything malicious?
• Is it possible to uninstall?
Ask others about their experience with it (on IRC or the mailing lists).
![Page 18: Oops, where's my site?](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54b686e04a79598c308b457d/html5/thumbnails/18.jpg)
A simple installation
![Page 19: Oops, where's my site?](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54b686e04a79598c308b457d/html5/thumbnails/19.jpg)
Buildout.cfg formatParts
Each part has a header in square brackets:
[buildout][buildout]
Variables
Each part contains multiple variables below the header:
[buildout][buildout]extends = http://dist.plone.org/release/4.1.2/versions.cfgparts = instance
Variables can interpolate other variables
[instance][instance]eggs = ${buildout:eggs}
![Page 20: Oops, where's my site?](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54b686e04a79598c308b457d/html5/thumbnails/20.jpg)
Adding PloneFormGen
Add the name of the distribution to the eggs variable.
Which part?
[instance][instance]eggs =
PloneProducts.PloneFormGen
But in the Unified installer buildout the instance eggs are based on thebuildout eggs:
[instance][instance]eggs = ${buildout:eggs}
So you can add to buildout eggs:
[buildout][buildout]eggs =
PloneProducts.PloneFormGen
![Page 21: Oops, where's my site?](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54b686e04a79598c308b457d/html5/thumbnails/21.jpg)
Run buildout
$ bin/buildout
For verbose info:
$ bin/buildout -v
Confirm it was installed
Examine the instance script.
![Page 22: Oops, where's my site?](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54b686e04a79598c308b457d/html5/thumbnails/22.jpg)
Identifying picked versions
If we used buildout.dumppickedversions, it shows us which versions were"picked":
*************** PICKED VERSIONS ****************[versions]Products.PloneFormGen = 1.7b5Products.PythonField = 1.1.3Products.TALESField = 1.1.3Products.TemplateFields = 1.2.5
#Required by:#Products.PloneFormGen 1.7b5collective.js.jqueryui = 1.8.5.2
![Page 23: Oops, where's my site?](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54b686e04a79598c308b457d/html5/thumbnails/23.jpg)
Pinning picked versions
Add them to the versions buildout part:
[versions][versions]Products.PloneFormGen = 1.7b5Products.PythonField = 1.1.3Products.TALESField = 1.1.3Products.TemplateFields = 1.2.5
#Required by:#Products.PloneFormGen 1.7b5collective.js.jqueryui = 1.8.5.2
Now if you re-run buildout, it should show no picked versions.
![Page 24: Oops, where's my site?](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54b686e04a79598c308b457d/html5/thumbnails/24.jpg)
Inferior pinning
Why not do this?
[buildout][buildout]eggs = Products.PloneFormGen==1.7b5
Because the version doesn't get used if PloneFormGen is a dependency ofsomething else.
![Page 25: Oops, where's my site?](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54b686e04a79598c308b457d/html5/thumbnails/25.jpg)
Being strict about pinning
Disallow picked versions:
[buildout][buildout]allow-picked-versions = false
![Page 26: Oops, where's my site?](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54b686e04a79598c308b457d/html5/thumbnails/26.jpg)
Starting Zope
Use the instance script in foreground mode to make failures obvious:
$ bin/instance fg
![Page 27: Oops, where's my site?](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54b686e04a79598c308b457d/html5/thumbnails/27.jpg)
Activating the add-on
Site Setup > Add-ons
![Page 28: Oops, where's my site?](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54b686e04a79598c308b457d/html5/thumbnails/28.jpg)
A complex installation
![Page 29: Oops, where's my site?](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54b686e04a79598c308b457d/html5/thumbnails/29.jpg)
Installing Dexterity
[buildout][buildout]extends = http://good-py.appspot.com/release/dexterity/1.0.3?plone=4.1.2
[instance][instance]eggs =
plone.app.dexterity
![Page 30: Oops, where's my site?](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54b686e04a79598c308b457d/html5/thumbnails/30.jpg)
good-py
• A tool for building and distributing known good sets
• One KGS can extend another
• A KGS can be constrained by a particular platform
![Page 31: Oops, where's my site?](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54b686e04a79598c308b457d/html5/thumbnails/31.jpg)
Upgrading an add-on
1. Update the version pins for the add-on and any dependencies.
2. Re-run buildout and restart Zope.
3. Go to Add-ons control panel and check if there are upgrade steps to run.
![Page 32: Oops, where's my site?](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54b686e04a79598c308b457d/html5/thumbnails/32.jpg)
What could possibly go wrong?
![Page 33: Oops, where's my site?](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54b686e04a79598c308b457d/html5/thumbnails/33.jpg)
Incompatible version pins
Example:
The version, 1.1.2, is not consistent with the requirement,'plone.app.jquerytools>=1.2dev'.While:
Installing instance.Error: Bad version 1.1.2
Reason: PloneFormGen requires plone.app.jquerytools >= 1.2dev, but I have itpinned to 1.1.2.
How did I know?:
Getting required 'collective.js.jqueryui'required by Products.PloneFormGen 1.7b6.
Picked: collective.js.jqueryui = 1.8.13.1The version, 1.1.2, is not consistent with the requirement,'plone.app.jquerytools>=1.2dev'.While:
Installing instance.Error: Bad version 1.1.2
Solution: Upgrade plone.app.jquerytools (with care).
![Page 34: Oops, where's my site?](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54b686e04a79598c308b457d/html5/thumbnails/34.jpg)
PyPI times out
Symptom: Error message about the egg not being available.
Solution: Temporarily use a mirror of the package index:
[buildout][buildout]index = http://d.pypi.python.org/simple
![Page 35: Oops, where's my site?](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54b686e04a79598c308b457d/html5/thumbnails/35.jpg)
ZCML not loaded
Symptom: The product you installed doesn't show up in the Add-ons controlpanel.
Reason: Many add-ons "announce" themselves to Plone so that Plone loads theirconfiguration, but some are missing this.
Solution: Include the package's ZCML in buildout, re-run buildout, and restart:
[instance][instance]zcml =
my.package
![Page 36: Oops, where's my site?](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54b686e04a79598c308b457d/html5/thumbnails/36.jpg)
Other errors while starting up
Seeking help:
• Send the full traceback to the add-on's author
• Ask in #plone channel on IRC
• Ask on the plone-users mailing list
![Page 37: Oops, where's my site?](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54b686e04a79598c308b457d/html5/thumbnails/37.jpg)
Room for improvement
![Page 38: Oops, where's my site?](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54b686e04a79598c308b457d/html5/thumbnails/38.jpg)
plonelint tool
![Page 39: Oops, where's my site?](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54b686e04a79598c308b457d/html5/thumbnails/39.jpg)
"Dry run mode" for buildout
![Page 40: Oops, where's my site?](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54b686e04a79598c308b457d/html5/thumbnails/40.jpg)
Communal Known Good Set
(KGS)
![Page 41: Oops, where's my site?](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54b686e04a79598c308b457d/html5/thumbnails/41.jpg)
UI for installing packages
![Page 42: Oops, where's my site?](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54b686e04a79598c308b457d/html5/thumbnails/42.jpg)
Questions