Some helpers and examples to use during migrations.
They are mostly meant to copy & paste the code from here to your own packages.
This was written for the talk "Migrations! Migrations! Migrations!" at Plone Conference 2019 in Ferrara: https://2019.ploneconf.org/talks/migrations-migrations-migrations
Here is a list of methods this package contains:
Browser-Views to get information about the portal:
- Get info about the content is in the portal.
- How many MB of which content is there really?
- Get info about content-types that may needs to be replaced
- Export info about local roles. A alternative would be zopyx.plone.cassandra
Prepare the portal for a migration
- Disable solr
- Disable ldap/ad-plugins
- Remove any portal_skin an portal_view_customization overrides.
- Release all WebDAV Locks.
Fremove obsolete content and settings
- Deletes heavy content
- Clear out portal_historiesstorage
- Disable diazo theme, enable sunburst (useful for Plone 4)
- Remove 95% of all content leaving at least one item for each type. Keep all folderish items unless specified.
- Example that removes Products.PloneFormGen
- Example that removes Products.PloneKeywordManager
- Example that removes Solgema.fullcalendar
- Example that removes a cubic ton of addons
- Remove obsolete behaviors
- Example that removes p4a.subtyper utilities
Some examples that remove various adapters, subscriber and utilities. For example:
- Remove an interface from all utility registrations. There are several places where an interface like IKSSRegistry can have lodged itself. We need to find them all, otherwise you are not even able to see the ZMI when going to Plone 5.2.
- Example that removes p4a.subtyper utilities (used in collective.easyslideshow)
- Example that removes portal_kss and removes IKSSRegistry from four places in the site manager.
- Use alias_module (see patches.py)
Remove broken and outdated import/export steps
Examples that can help migrating from LinguaPlone to plone.app.multilingual
- Crazy method that sets languages, adds and links translations so that we can migrate to pam.
- Install pam and setup site
- Migrate LinguaPlone to plone.app.multilingual This mostly uses the migration that is builtin in plone.app.multilingual
Methods to migrate default content to Dexterity.
A example that migrated PloneHelpCenter to default Dexterity content.
- Run the whole miration
- Remove custom layout.
- Example custom field-migrator that appends text to a existing richtext-field.
- Example custom field-migrator that appends text to a existing text-field.
- Some Methods that migrate the various types in PHC
- Uninstall Archetypes and remove all of its traces.
Multiple examples of patches using alias_module to deal with migration-problems.
- Fix/Migrate custom images/scales and broken links to AT-based images. This only finds content with the rich text behavior, so not all rich text fields.
- Metadata on brains is still old DateTime
- Fix bytes in opkapiindex
- Fix portlets that use a ComputedValue for path-storage instead of a UUID
- Fix conversations that still have the old AT content as __parent__
- Remove registry-records where the interface is no longer there.
- Exports all valid reations from the relation-catalog, purges the relation-catalog (and the intid-catalog) and restores all valid relations. Uses collective.relationhelpers
- Export all relations as a json file all_relations.json in you buildout directory. Uses collective.relationhelpers
- Recreate relations from a annotation on the portal or a list of dicts (e.g. restored from the json-file created by export_relations). This works fine for all kinds of relations, RelationList- or RelationChoice-fields (including the default field "Related Items") as well as for linkintegrity-relations and relations between working-copies. Uses collective.relationhelpers
- Purge all RelationValues and all references to broken objects from the IntId catalog. Uses collective.relationhelpers
Example method for final touces after migrating to 5.2 with py3
- Disable a subscriber
- Re-enable a subscriber
- Disable all content rules
- Re-enable all content rules
- Example to use the above
- Rebuild the whole catalog but skip reindexing blobs since that takes a long time.
- Pack the database
Example of a profile that removes all kinds of stuff that was added with Generic Setup.
Bonus: Fixes modal for login.
Example for some maybe sensible registry-settings for migrated sites.
This is mostly meant to copy&paste the code from here to your own packages.
Installation is still possible: To install it add it to your buildout:
[buildout] ... eggs = collective.migrationhelpers
and then running
- Issue Tracker: https://github.com/collective/collective.migrationhelpers/issues
- Source Code: https://github.com/collective/collective.migrationhelpers
The project is licensed under the GPLv2.