SlideShare a Scribd company logo
Journeys with Transmogrifier & 
friends 
or 
How not to get stuck in 
the Plone dark ages 
Daniel Jowett 
Jowett Enterprises Ltd
About me 
● Software Professional since 1997 
● Background in C, Java, SQL, etc …. even P*P 
● Using Plone since 2008 on starting self-employment 
● Once upon a time... 
● … I came to a Plone Conference in Bristol... 
● … in 2010 
● And everyone seemed to be cleverer than me 
● And now 4 years later? ... 
● I know most of them are cleverer than me 
● But I have done 4 or 5 projects with Transmogrifer / Jsonmigrator
Foundational Principles 
● Calvin & Hobbes 
● Calvin is an over-imaginative 6 year old 
● Hobbes is his toy tiger 
● A cardboard box can be anything 
● But in this case it's a “Transmogrifier”
Transmogrifier: ...what is it? 
● Transmogrifier – turns 
something into anything else 
like Calvin into a toad, or tiger 
● Plone's Transmogrifier: 
a way to migrate content 
– typically between Plone versions 
– also from plain html sites & other CMS databases 
– Aims for and achieves a decent amount of code reuse 
● JsonMigrator: Builds on top of Transmogrifier so you don't have to 
install it in the source Plone site
Transmogrifier Variants 
● Plain Transmogrifier – 2 stage process to export/import from Plone 
site via xml files (or csv files) 
● Funnelweb - Crawls and parses static sites for import, which are then 
'pushed' into Plone 
● Jsonmigrator – 1 stage process that crawls Json views of an old site 
● Transmogrifier blueprints also exist that can read from SQL Dbs, so 
for example Drupal data 
We will be focussing on Jsonmigrator
When to use Jsonmigrator 
● From old Plone versions, like 2.5, but even as far back as 1.0 in theory 
(but requires Python >= 2.2) 
● Even from old Zope/CMF sites 
● particularly when you have no buildout 
● When changing content type framework from archetypes to dexterity 
● To clean cruft out of an error prone old site 
● When scared to upgrade because you don't know what might bite you 
later 
Note: This isn't the whole story - you still have to Upgrade Your Plone 
products & custom code
When NOT to use Transmogrifier 
● From Plone 4.x 
● Probably not from 3.3.6 with buildout 
● Without considering the alternatives: 
– running Plone upgrade steps (plone.app.upgrade) 
– plone.app.contenttypes migration for AT to DX based types
Technology Stack 
● Transmogrifier: 
– plone.app.transmogrifier 
– collective.transmogrifier 
● collective.jsonify 
● collective.jsonmigrator 
● Products containing extra pipeline sections, such as: 
– transmogrify.dexterity 
– quintagroup.transmogrifier 
– transmogrify.print
Setting Up Jsonmigrator 
1) * Duplicate old Plone in your staging environment 
2) install collective.jsonify to this duplicate 
3) Add “external methods” 
4) * Create a brand new Plone 4.x instance (try 4.3.3 for starters) 
5) * Install the updated or replacement products you need to the new 
instance 
6) install collective.jsonmigrator & any special pipeline sections to new 
instance 
* These steps are outside the scope of this presentation – hopefully 
you've got an idea of what to do here (though step 5 may well not be 
trivial)
Install collective.jsonify 
This is the really old way to install stuff & generally bad practise, but if 
you are using a virtualenv (or dedicated python) it's passable. It's much 
easier if you're using buildout, but I'll assume that you're not! 
1. Download the egg (my version in this case) to your Plone directory: 
wget https://github.com/djowett/collective.jsonify/archive/0.1.8b.zip 
2. Unzip it 
unzip 0.1.8b.zip 
3. Add it to your python (it will also pull in simplejson) 
cd collective.jsonify-0.1.8b/ 
../bin/zopepy setup.py install 
… 
Adding collective.jsonify 0.1.8b to easy-install.pth file 
… 
… simplejson...
Add “External Methods” 
● Add an Extensions folder 
● Add json_methods.py 
from collective.jsonify import get_item 
from collective.jsonify import get_children 
from collective.jsonify import get_catalog_results 
● Then run your Plone instance, go to the Zope root and create the three 
equivalently named External Methods, ie: “get_item”, “get_children” 
& “get_catalog_results”, eg:
Install collective.jsonmigrator 
● Add the highlighted lines to your buildout's: develop.cfg 
[sources] 
... 
collective.jsonmigrator = git https://github.com/djowett/collective.jsonmigrator.git 
[buildout] 
eggs += 
... 
collective.jsonmigrator 
● You might also want to add transmogrify pipelines like 
transmogrify.dexterity or quintagroup.transmogrifier to your eggs 
section 
● Then run buildout & run up your instance 
Note: We check out the collective.jsonmigrator egg for development so 
that we can tweak the pipeline configuration when we need to
Looking closer 
● Installing Collective.jsonify & the external methods gives a (fairly) 
complete json view of every piece of content on your old site 
● For example... 
● Collective.jsonmigrator can pick up these json data dictionarys, and 
using transmogrifier 'massage' them and create the corresponding 
objects on your new site
Have a go! 
● Go to: http://<your-plone>:<port>/<instance>/@@jsonmigrator 
● Select one of the pre-loaded sample configurations 
● Select username, password & a small folder for your first run
Demo
So what happened there? (I) 
● This was our “pipeline” 
[transmogrifier] 
pipeline = 
remotesource 
removeid 
strip-leading-path 
correct-zope-file-types 
fix_index_html_in_id 
fix_index_html_in_path 
print_seq_in_desc 
description_remove_seq 
tag_general_if_ccsnews_in_desc 
tag_service_if_ccsnews_not_in_desc 
description_remove_ccsnews 
find_path_depth 
repl_relative_urls_in_text 
get_hardcoded_urls_in_text 
print_hardcoded_url_post_replace 
get_siteImage_urls_in_text 
print_siteImage_urls 
fix_index_html_refs_in_text 
find_h1_title_in_text 
remove_h1_title_from_text 
constructor 
schema 
uid 
datafields 
fix_defaultPage 
# print_defaultpage 
browser-default 
# workflow-history 
get-last-workflow-state 
calc-workflow-transition 
publish_all_folders 
workflowupdater 
properties 
# permissions 
owner 
local_roles 
mimetype 
commit 
IMPORTING
So what happened there? (II) 
● Here are some pipeline section definitions: 
[constructor] 
blueprint = collective.transmogrifier.sections.constructor 
# Zope Images & Files get incorrectly reported as Folders 
[correct-zope-file-types] 
blueprint = collective.transmogrifier.sections.manipulator 
keys = _classname 
destination = python:"_type" 
condition = python:(item['_type'] == 'Folder' and item.has_key('_classname') 
and item['_classname'] in ['Image', 'File']) 
[strip-leading-path] 
blueprint = collective.transmogrifier.sections.inserter 
key = string:_path 
value = python: item['_path'].replace('ccs/', '', 1) 
[tag_general_if_ccsnews_in_desc] 
blueprint = collective.transmogrifier.sections.inserter 
key = string:subject 
value = python: item['subject'] + ['general'] 
condition = python: item['_type'] == "News Item" and 'ccsnews' in item['description']
Real life isn't Blue Peter* 
So, even if it did work just now, it will probably break for you first time, 
so make some adjustments in the pipeline 
(<instance>/src/collective.jsonmigrator/collective/jsonmigrator/ 
config_plone3.cfg) 
● Exclude objects from the import (particularly plone tools) 
● Use print a lot (from transmogrify.print) 
● Delete the import results (if you had any) & run again 
* Blue Peter was the staple TV diet for 1980's Kids in the UK, featuring 
the oft used phrase “here's one I made earlier” when things didn't work
Benefits compared to Legacy Plone 
● A fresh start 
● A chance to use new Plone technologies like Diazo, Dexterity, new 
Collections, plone.app.contenttypes. etc. etc. 
● Moving from retired products to cutting edge equivalents 
● The speed of Plone 4 & blob storage 
● Using buildout to control your site
Caveats 
● This doesn't export/import users (though see 
collective.blueprint.usersandgroups) 
● And it doesn't do portlets 
(portlets can be exported by generic setup, but that doesn't include 
“deep” content portlets – you might be stuck with a manual portlet 
setup) 
● Collective.jsonify ignores Plone's security model and is a security 
loophole – add this to a publicly accessible site at your own risk 
● The docs can be a little misleading at times 
● Many folk using this are probably working off checked out code, so 
egg releases are few & far between – you are going to have to get your 
hands dirty 
● “Debugging is backwards” in transmogrifier
Credits 
● Transmogrifier – Martjin Pieters, Jarn 
● Jsonmigrator - Rok Garbas 
● RCS – letting me loose on this 
● Calvin & Hobbes – Bill Watterson – creating the original 
Transmogrifier 
Links 
● http://www.jowettenterprises.com/blog/jsonmigrator 
● http://collectivejsonify.readthedocs.org/ 
● http://collectivejsonmigrator.readthedocs.org/
Fin 
Daniel Jowett 
www.jowettenterprises.com 
daniel@jowettenterprises.com 
IRC nick: danima1 
Github user: djowett
Ad

More Related Content

What's hot (20)

The GO Language : From Beginners to Gophers
The GO Language : From Beginners to GophersThe GO Language : From Beginners to Gophers
The GO Language : From Beginners to Gophers
I.I.S. G. Vallauri - Fossano
 
Beauty and Power of Go
Beauty and Power of GoBeauty and Power of Go
Beauty and Power of Go
Frank Müller
 
Using Flow-based programming to write tools and workflows for Scientific Comp...
Using Flow-based programming to write tools and workflows for Scientific Comp...Using Flow-based programming to write tools and workflows for Scientific Comp...
Using Flow-based programming to write tools and workflows for Scientific Comp...
Samuel Lampa
 
Inside the JVM - Follow the white rabbit!
Inside the JVM - Follow the white rabbit!Inside the JVM - Follow the white rabbit!
Inside the JVM - Follow the white rabbit!
Sylvain Wallez
 
Geeks Anonymes - Le langage Go
Geeks Anonymes - Le langage GoGeeks Anonymes - Le langage Go
Geeks Anonymes - Le langage Go
Geeks Anonymes
 
Functional Reactive Programming without Black Magic (UIKonf 2015)
Functional Reactive Programming without Black Magic (UIKonf 2015)Functional Reactive Programming without Black Magic (UIKonf 2015)
Functional Reactive Programming without Black Magic (UIKonf 2015)
Jens Ravens
 
7 Common Mistakes in Go (2015)
7 Common Mistakes in Go (2015)7 Common Mistakes in Go (2015)
7 Common Mistakes in Go (2015)
Steven Francia
 
Golang
GolangGolang
Golang
Software Infrastructure
 
Vim and Python
Vim and PythonVim and Python
Vim and Python
majmcdonald
 
Hipster oriented programming (Mobilization Lodz 2015)
Hipster oriented programming (Mobilization Lodz 2015)Hipster oriented programming (Mobilization Lodz 2015)
Hipster oriented programming (Mobilization Lodz 2015)
Jens Ravens
 
7 Common mistakes in Go and when to avoid them
7 Common mistakes in Go and when to avoid them7 Common mistakes in Go and when to avoid them
7 Common mistakes in Go and when to avoid them
Steven Francia
 
Learning Git with Workflows
Learning Git with WorkflowsLearning Git with Workflows
Learning Git with Workflows
Mosky Liu
 
wxFormBuilder - Tutorial on “A GUI for making GUIs” for Python
wxFormBuilder - Tutorial on “A GUI for making GUIs” for PythonwxFormBuilder - Tutorial on “A GUI for making GUIs” for Python
wxFormBuilder - Tutorial on “A GUI for making GUIs” for Python
Umar Yusuf
 
Introduction to Google's Go programming language
Introduction to Google's Go programming languageIntroduction to Google's Go programming language
Introduction to Google's Go programming language
Mario Castro Contreras
 
groovy & grails - lecture 5
groovy & grails - lecture 5groovy & grails - lecture 5
groovy & grails - lecture 5
Alexandre Masselot
 
Introduction to Programming in Go
Introduction to Programming in GoIntroduction to Programming in Go
Introduction to Programming in Go
Amr Hassan
 
Groovy for Java Developers
Groovy for Java DevelopersGroovy for Java Developers
Groovy for Java Developers
Andres Almiray
 
Happy hacking with Plone
Happy hacking with PloneHappy hacking with Plone
Happy hacking with Plone
Makina Corpus
 
Groovy for java developers
Groovy for java developersGroovy for java developers
Groovy for java developers
Puneet Behl
 
Testing con spock
Testing con spockTesting con spock
Testing con spock
Fátima Casaú Pérez
 
Beauty and Power of Go
Beauty and Power of GoBeauty and Power of Go
Beauty and Power of Go
Frank Müller
 
Using Flow-based programming to write tools and workflows for Scientific Comp...
Using Flow-based programming to write tools and workflows for Scientific Comp...Using Flow-based programming to write tools and workflows for Scientific Comp...
Using Flow-based programming to write tools and workflows for Scientific Comp...
Samuel Lampa
 
Inside the JVM - Follow the white rabbit!
Inside the JVM - Follow the white rabbit!Inside the JVM - Follow the white rabbit!
Inside the JVM - Follow the white rabbit!
Sylvain Wallez
 
Geeks Anonymes - Le langage Go
Geeks Anonymes - Le langage GoGeeks Anonymes - Le langage Go
Geeks Anonymes - Le langage Go
Geeks Anonymes
 
Functional Reactive Programming without Black Magic (UIKonf 2015)
Functional Reactive Programming without Black Magic (UIKonf 2015)Functional Reactive Programming without Black Magic (UIKonf 2015)
Functional Reactive Programming without Black Magic (UIKonf 2015)
Jens Ravens
 
7 Common Mistakes in Go (2015)
7 Common Mistakes in Go (2015)7 Common Mistakes in Go (2015)
7 Common Mistakes in Go (2015)
Steven Francia
 
Hipster oriented programming (Mobilization Lodz 2015)
Hipster oriented programming (Mobilization Lodz 2015)Hipster oriented programming (Mobilization Lodz 2015)
Hipster oriented programming (Mobilization Lodz 2015)
Jens Ravens
 
7 Common mistakes in Go and when to avoid them
7 Common mistakes in Go and when to avoid them7 Common mistakes in Go and when to avoid them
7 Common mistakes in Go and when to avoid them
Steven Francia
 
Learning Git with Workflows
Learning Git with WorkflowsLearning Git with Workflows
Learning Git with Workflows
Mosky Liu
 
wxFormBuilder - Tutorial on “A GUI for making GUIs” for Python
wxFormBuilder - Tutorial on “A GUI for making GUIs” for PythonwxFormBuilder - Tutorial on “A GUI for making GUIs” for Python
wxFormBuilder - Tutorial on “A GUI for making GUIs” for Python
Umar Yusuf
 
Introduction to Google's Go programming language
Introduction to Google's Go programming languageIntroduction to Google's Go programming language
Introduction to Google's Go programming language
Mario Castro Contreras
 
Introduction to Programming in Go
Introduction to Programming in GoIntroduction to Programming in Go
Introduction to Programming in Go
Amr Hassan
 
Groovy for Java Developers
Groovy for Java DevelopersGroovy for Java Developers
Groovy for Java Developers
Andres Almiray
 
Happy hacking with Plone
Happy hacking with PloneHappy hacking with Plone
Happy hacking with Plone
Makina Corpus
 
Groovy for java developers
Groovy for java developersGroovy for java developers
Groovy for java developers
Puneet Behl
 

Similar to Journeys with Transmogrifier and friends or How not to get stuck in the Plone dark ages (20)

Frequently asked questions answered frequently - but now for the last time
Frequently asked questions answered frequently - but now for the last timeFrequently asked questions answered frequently - but now for the last time
Frequently asked questions answered frequently - but now for the last time
Andreas Jung
 
Philipp Von Weitershausen Plone Age Mammoths, Sabers And Caveen Cant The...
Philipp Von Weitershausen   Plone Age  Mammoths, Sabers And Caveen   Cant The...Philipp Von Weitershausen   Plone Age  Mammoths, Sabers And Caveen   Cant The...
Philipp Von Weitershausen Plone Age Mammoths, Sabers And Caveen Cant The...
Vincenzo Barone
 
Plomino plone conf2010
Plomino plone conf2010Plomino plone conf2010
Plomino plone conf2010
ebrehault
 
Docker and Go: why did we decide to write Docker in Go?
Docker and Go: why did we decide to write Docker in Go?Docker and Go: why did we decide to write Docker in Go?
Docker and Go: why did we decide to write Docker in Go?
Jérôme Petazzoni
 
PyCourse - Self driving python course
PyCourse - Self driving python coursePyCourse - Self driving python course
PyCourse - Self driving python course
Eran Shlomo
 
Devops Devops Devops, at Froscon
Devops Devops Devops, at FrosconDevops Devops Devops, at Froscon
Devops Devops Devops, at Froscon
Kris Buytaert
 
Pentester++
Pentester++Pentester++
Pentester++
CTruncer
 
Old Dogs and New Tricks
Old Dogs and New TricksOld Dogs and New Tricks
Old Dogs and New Tricks
Elizabeth Leddy
 
11 tools for your PHP devops stack
11 tools for your PHP devops stack11 tools for your PHP devops stack
11 tools for your PHP devops stack
Kris Buytaert
 
Devops For Drupal
Devops  For DrupalDevops  For Drupal
Devops For Drupal
Kris Buytaert
 
The State of the Veil Framework
The State of the Veil FrameworkThe State of the Veil Framework
The State of the Veil Framework
VeilFramework
 
A winning combination: Plone as CMS and your favorite Python web framework as...
A winning combination: Plone as CMS and your favorite Python web framework as...A winning combination: Plone as CMS and your favorite Python web framework as...
A winning combination: Plone as CMS and your favorite Python web framework as...
Carlos de la Guardia
 
A novel approach to Undo
A novel approach to UndoA novel approach to Undo
A novel approach to Undo
Sean Upton
 
7 Tools for your Puppetized Devops stack
7 Tools for your Puppetized Devops stack7 Tools for your Puppetized Devops stack
7 Tools for your Puppetized Devops stack
Kris Buytaert
 
Django Girls Tutorial
Django Girls TutorialDjango Girls Tutorial
Django Girls Tutorial
Kishimi Ibrahim Ishaq
 
Puppet managed loadays
Puppet managed loadaysPuppet managed loadays
Puppet managed loadays
Yankee Nemoy
 
Smarter deployments with octopus deploy
Smarter deployments with octopus deploySmarter deployments with octopus deploy
Smarter deployments with octopus deploy
Thibaud Gravrand
 
Django district pip, virtualenv, virtualenv wrapper & more
Django district  pip, virtualenv, virtualenv wrapper & moreDjango district  pip, virtualenv, virtualenv wrapper & more
Django district pip, virtualenv, virtualenv wrapper & more
Jacqueline Kazil
 
Organizing JavaScript
Organizing JavaScriptOrganizing JavaScript
Organizing JavaScript
mcordingley
 
Hadoop: Big Data Stacks validation w/ iTest How to tame the elephant?
Hadoop:  Big Data Stacks validation w/ iTest  How to tame the elephant?Hadoop:  Big Data Stacks validation w/ iTest  How to tame the elephant?
Hadoop: Big Data Stacks validation w/ iTest How to tame the elephant?
Dmitri Shiryaev
 
Frequently asked questions answered frequently - but now for the last time
Frequently asked questions answered frequently - but now for the last timeFrequently asked questions answered frequently - but now for the last time
Frequently asked questions answered frequently - but now for the last time
Andreas Jung
 
Philipp Von Weitershausen Plone Age Mammoths, Sabers And Caveen Cant The...
Philipp Von Weitershausen   Plone Age  Mammoths, Sabers And Caveen   Cant The...Philipp Von Weitershausen   Plone Age  Mammoths, Sabers And Caveen   Cant The...
Philipp Von Weitershausen Plone Age Mammoths, Sabers And Caveen Cant The...
Vincenzo Barone
 
Plomino plone conf2010
Plomino plone conf2010Plomino plone conf2010
Plomino plone conf2010
ebrehault
 
Docker and Go: why did we decide to write Docker in Go?
Docker and Go: why did we decide to write Docker in Go?Docker and Go: why did we decide to write Docker in Go?
Docker and Go: why did we decide to write Docker in Go?
Jérôme Petazzoni
 
PyCourse - Self driving python course
PyCourse - Self driving python coursePyCourse - Self driving python course
PyCourse - Self driving python course
Eran Shlomo
 
Devops Devops Devops, at Froscon
Devops Devops Devops, at FrosconDevops Devops Devops, at Froscon
Devops Devops Devops, at Froscon
Kris Buytaert
 
Pentester++
Pentester++Pentester++
Pentester++
CTruncer
 
11 tools for your PHP devops stack
11 tools for your PHP devops stack11 tools for your PHP devops stack
11 tools for your PHP devops stack
Kris Buytaert
 
The State of the Veil Framework
The State of the Veil FrameworkThe State of the Veil Framework
The State of the Veil Framework
VeilFramework
 
A winning combination: Plone as CMS and your favorite Python web framework as...
A winning combination: Plone as CMS and your favorite Python web framework as...A winning combination: Plone as CMS and your favorite Python web framework as...
A winning combination: Plone as CMS and your favorite Python web framework as...
Carlos de la Guardia
 
A novel approach to Undo
A novel approach to UndoA novel approach to Undo
A novel approach to Undo
Sean Upton
 
7 Tools for your Puppetized Devops stack
7 Tools for your Puppetized Devops stack7 Tools for your Puppetized Devops stack
7 Tools for your Puppetized Devops stack
Kris Buytaert
 
Puppet managed loadays
Puppet managed loadaysPuppet managed loadays
Puppet managed loadays
Yankee Nemoy
 
Smarter deployments with octopus deploy
Smarter deployments with octopus deploySmarter deployments with octopus deploy
Smarter deployments with octopus deploy
Thibaud Gravrand
 
Django district pip, virtualenv, virtualenv wrapper & more
Django district  pip, virtualenv, virtualenv wrapper & moreDjango district  pip, virtualenv, virtualenv wrapper & more
Django district pip, virtualenv, virtualenv wrapper & more
Jacqueline Kazil
 
Organizing JavaScript
Organizing JavaScriptOrganizing JavaScript
Organizing JavaScript
mcordingley
 
Hadoop: Big Data Stacks validation w/ iTest How to tame the elephant?
Hadoop:  Big Data Stacks validation w/ iTest  How to tame the elephant?Hadoop:  Big Data Stacks validation w/ iTest  How to tame the elephant?
Hadoop: Big Data Stacks validation w/ iTest How to tame the elephant?
Dmitri Shiryaev
 
Ad

Recently uploaded (20)

Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Andre Hora
 
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Orangescrum
 
Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)
Allon Mureinik
 
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
University of Hawai‘i at Mānoa
 
PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025
mu394968
 
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Dele Amefo
 
Kubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptxKubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptx
CloudScouts
 
Download Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With LatestDownload Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With Latest
tahirabibi60507
 
Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025
mu394968
 
Landscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature ReviewLandscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature Review
Hironori Washizaki
 
FL Studio Producer Edition Crack 2025 Full Version
FL Studio Producer Edition Crack 2025 Full VersionFL Studio Producer Edition Crack 2025 Full Version
FL Studio Producer Edition Crack 2025 Full Version
tahirabibi60507
 
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Lionel Briand
 
Not So Common Memory Leaks in Java Webinar
Not So Common Memory Leaks in Java WebinarNot So Common Memory Leaks in Java Webinar
Not So Common Memory Leaks in Java Webinar
Tier1 app
 
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Ranjan Baisak
 
Exploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the FutureExploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the Future
ICS
 
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRYLEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
NidaFarooq10
 
Revolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptxRevolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptx
nidhisingh691197
 
Solidworks Crack 2025 latest new + license code
Solidworks Crack 2025 latest new + license codeSolidworks Crack 2025 latest new + license code
Solidworks Crack 2025 latest new + license code
aneelaramzan63
 
Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...
ssuserb14185
 
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
AxisTechnolabs
 
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Andre Hora
 
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Orangescrum
 
Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)
Allon Mureinik
 
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
University of Hawai‘i at Mānoa
 
PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025
mu394968
 
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Dele Amefo
 
Kubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptxKubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptx
CloudScouts
 
Download Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With LatestDownload Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With Latest
tahirabibi60507
 
Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025
mu394968
 
Landscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature ReviewLandscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature Review
Hironori Washizaki
 
FL Studio Producer Edition Crack 2025 Full Version
FL Studio Producer Edition Crack 2025 Full VersionFL Studio Producer Edition Crack 2025 Full Version
FL Studio Producer Edition Crack 2025 Full Version
tahirabibi60507
 
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Lionel Briand
 
Not So Common Memory Leaks in Java Webinar
Not So Common Memory Leaks in Java WebinarNot So Common Memory Leaks in Java Webinar
Not So Common Memory Leaks in Java Webinar
Tier1 app
 
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Ranjan Baisak
 
Exploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the FutureExploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the Future
ICS
 
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRYLEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
NidaFarooq10
 
Revolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptxRevolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptx
nidhisingh691197
 
Solidworks Crack 2025 latest new + license code
Solidworks Crack 2025 latest new + license codeSolidworks Crack 2025 latest new + license code
Solidworks Crack 2025 latest new + license code
aneelaramzan63
 
Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...
ssuserb14185
 
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
AxisTechnolabs
 
Ad

Journeys with Transmogrifier and friends or How not to get stuck in the Plone dark ages

  • 1. Journeys with Transmogrifier & friends or How not to get stuck in the Plone dark ages Daniel Jowett Jowett Enterprises Ltd
  • 2. About me ● Software Professional since 1997 ● Background in C, Java, SQL, etc …. even P*P ● Using Plone since 2008 on starting self-employment ● Once upon a time... ● … I came to a Plone Conference in Bristol... ● … in 2010 ● And everyone seemed to be cleverer than me ● And now 4 years later? ... ● I know most of them are cleverer than me ● But I have done 4 or 5 projects with Transmogrifer / Jsonmigrator
  • 3. Foundational Principles ● Calvin & Hobbes ● Calvin is an over-imaginative 6 year old ● Hobbes is his toy tiger ● A cardboard box can be anything ● But in this case it's a “Transmogrifier”
  • 4. Transmogrifier: ...what is it? ● Transmogrifier – turns something into anything else like Calvin into a toad, or tiger ● Plone's Transmogrifier: a way to migrate content – typically between Plone versions – also from plain html sites & other CMS databases – Aims for and achieves a decent amount of code reuse ● JsonMigrator: Builds on top of Transmogrifier so you don't have to install it in the source Plone site
  • 5. Transmogrifier Variants ● Plain Transmogrifier – 2 stage process to export/import from Plone site via xml files (or csv files) ● Funnelweb - Crawls and parses static sites for import, which are then 'pushed' into Plone ● Jsonmigrator – 1 stage process that crawls Json views of an old site ● Transmogrifier blueprints also exist that can read from SQL Dbs, so for example Drupal data We will be focussing on Jsonmigrator
  • 6. When to use Jsonmigrator ● From old Plone versions, like 2.5, but even as far back as 1.0 in theory (but requires Python >= 2.2) ● Even from old Zope/CMF sites ● particularly when you have no buildout ● When changing content type framework from archetypes to dexterity ● To clean cruft out of an error prone old site ● When scared to upgrade because you don't know what might bite you later Note: This isn't the whole story - you still have to Upgrade Your Plone products & custom code
  • 7. When NOT to use Transmogrifier ● From Plone 4.x ● Probably not from 3.3.6 with buildout ● Without considering the alternatives: – running Plone upgrade steps (plone.app.upgrade) – plone.app.contenttypes migration for AT to DX based types
  • 8. Technology Stack ● Transmogrifier: – plone.app.transmogrifier – collective.transmogrifier ● collective.jsonify ● collective.jsonmigrator ● Products containing extra pipeline sections, such as: – transmogrify.dexterity – quintagroup.transmogrifier – transmogrify.print
  • 9. Setting Up Jsonmigrator 1) * Duplicate old Plone in your staging environment 2) install collective.jsonify to this duplicate 3) Add “external methods” 4) * Create a brand new Plone 4.x instance (try 4.3.3 for starters) 5) * Install the updated or replacement products you need to the new instance 6) install collective.jsonmigrator & any special pipeline sections to new instance * These steps are outside the scope of this presentation – hopefully you've got an idea of what to do here (though step 5 may well not be trivial)
  • 10. Install collective.jsonify This is the really old way to install stuff & generally bad practise, but if you are using a virtualenv (or dedicated python) it's passable. It's much easier if you're using buildout, but I'll assume that you're not! 1. Download the egg (my version in this case) to your Plone directory: wget https://github.com/djowett/collective.jsonify/archive/0.1.8b.zip 2. Unzip it unzip 0.1.8b.zip 3. Add it to your python (it will also pull in simplejson) cd collective.jsonify-0.1.8b/ ../bin/zopepy setup.py install … Adding collective.jsonify 0.1.8b to easy-install.pth file … … simplejson...
  • 11. Add “External Methods” ● Add an Extensions folder ● Add json_methods.py from collective.jsonify import get_item from collective.jsonify import get_children from collective.jsonify import get_catalog_results ● Then run your Plone instance, go to the Zope root and create the three equivalently named External Methods, ie: “get_item”, “get_children” & “get_catalog_results”, eg:
  • 12. Install collective.jsonmigrator ● Add the highlighted lines to your buildout's: develop.cfg [sources] ... collective.jsonmigrator = git https://github.com/djowett/collective.jsonmigrator.git [buildout] eggs += ... collective.jsonmigrator ● You might also want to add transmogrify pipelines like transmogrify.dexterity or quintagroup.transmogrifier to your eggs section ● Then run buildout & run up your instance Note: We check out the collective.jsonmigrator egg for development so that we can tweak the pipeline configuration when we need to
  • 13. Looking closer ● Installing Collective.jsonify & the external methods gives a (fairly) complete json view of every piece of content on your old site ● For example... ● Collective.jsonmigrator can pick up these json data dictionarys, and using transmogrifier 'massage' them and create the corresponding objects on your new site
  • 14. Have a go! ● Go to: http://<your-plone>:<port>/<instance>/@@jsonmigrator ● Select one of the pre-loaded sample configurations ● Select username, password & a small folder for your first run
  • 15. Demo
  • 16. So what happened there? (I) ● This was our “pipeline” [transmogrifier] pipeline = remotesource removeid strip-leading-path correct-zope-file-types fix_index_html_in_id fix_index_html_in_path print_seq_in_desc description_remove_seq tag_general_if_ccsnews_in_desc tag_service_if_ccsnews_not_in_desc description_remove_ccsnews find_path_depth repl_relative_urls_in_text get_hardcoded_urls_in_text print_hardcoded_url_post_replace get_siteImage_urls_in_text print_siteImage_urls fix_index_html_refs_in_text find_h1_title_in_text remove_h1_title_from_text constructor schema uid datafields fix_defaultPage # print_defaultpage browser-default # workflow-history get-last-workflow-state calc-workflow-transition publish_all_folders workflowupdater properties # permissions owner local_roles mimetype commit IMPORTING
  • 17. So what happened there? (II) ● Here are some pipeline section definitions: [constructor] blueprint = collective.transmogrifier.sections.constructor # Zope Images & Files get incorrectly reported as Folders [correct-zope-file-types] blueprint = collective.transmogrifier.sections.manipulator keys = _classname destination = python:"_type" condition = python:(item['_type'] == 'Folder' and item.has_key('_classname') and item['_classname'] in ['Image', 'File']) [strip-leading-path] blueprint = collective.transmogrifier.sections.inserter key = string:_path value = python: item['_path'].replace('ccs/', '', 1) [tag_general_if_ccsnews_in_desc] blueprint = collective.transmogrifier.sections.inserter key = string:subject value = python: item['subject'] + ['general'] condition = python: item['_type'] == "News Item" and 'ccsnews' in item['description']
  • 18. Real life isn't Blue Peter* So, even if it did work just now, it will probably break for you first time, so make some adjustments in the pipeline (<instance>/src/collective.jsonmigrator/collective/jsonmigrator/ config_plone3.cfg) ● Exclude objects from the import (particularly plone tools) ● Use print a lot (from transmogrify.print) ● Delete the import results (if you had any) & run again * Blue Peter was the staple TV diet for 1980's Kids in the UK, featuring the oft used phrase “here's one I made earlier” when things didn't work
  • 19. Benefits compared to Legacy Plone ● A fresh start ● A chance to use new Plone technologies like Diazo, Dexterity, new Collections, plone.app.contenttypes. etc. etc. ● Moving from retired products to cutting edge equivalents ● The speed of Plone 4 & blob storage ● Using buildout to control your site
  • 20. Caveats ● This doesn't export/import users (though see collective.blueprint.usersandgroups) ● And it doesn't do portlets (portlets can be exported by generic setup, but that doesn't include “deep” content portlets – you might be stuck with a manual portlet setup) ● Collective.jsonify ignores Plone's security model and is a security loophole – add this to a publicly accessible site at your own risk ● The docs can be a little misleading at times ● Many folk using this are probably working off checked out code, so egg releases are few & far between – you are going to have to get your hands dirty ● “Debugging is backwards” in transmogrifier
  • 21. Credits ● Transmogrifier – Martjin Pieters, Jarn ● Jsonmigrator - Rok Garbas ● RCS – letting me loose on this ● Calvin & Hobbes – Bill Watterson – creating the original Transmogrifier Links ● http://www.jowettenterprises.com/blog/jsonmigrator ● http://collectivejsonify.readthedocs.org/ ● http://collectivejsonmigrator.readthedocs.org/
  • 22. Fin Daniel Jowett www.jowettenterprises.com [email protected] IRC nick: danima1 Github user: djowett