Skip to main content

Introduction

by Giacomo Spettoli<giacomo.spettoli@gmail.com> and Regione Emilia-Romagna

This product is a user interface for migrate content based on framework Products.contentmigration.

The wizard will guide the site administrator with 3 step:

  1. select the desired migration from a list

  2. select in which contents apply the migration from a filtered site map

  3. confirm the migration.

This product also provide an easy way to register new migration. In “allmigration” folder you can find some example. Here the folderToLargeFolder migration:

class FolderToLargePloneFolder(object, ATFolderMigrator):
    """Migrate the old item type to the new item type
    """
    implements(IContentMigrator)

    walker = CustomQueryWalker
    src_meta_type = "ATFolder"
    src_portal_type = "Folder"
    dst_meta_type = "ATBTreeFolder"
    dst_portal_type = "Large Plone Folder"
    description = "Document to Document"
    safeMigration = True

    def __init__(self, *args, **kwargs):
        ATFolderMigrator.__init__(self, *args, **kwargs)
        self.fields_map = BASE_AT_PROPERTIES

FolderToLargePloneFolderMigrator = FolderToLargePloneFolder

In order to create your own migration you must create a class that extend ATFolderMigrator or ATItemMigrator:

from Products.contentmigration.archetypes import ATFolderMigrator,ATItemMigrator

This new class must implements IContentMigrator interface:

implements(IContentMigrator)

Next you insert source and destination portal_type and meta_type (you can find these values in zmi/portal_types):

src_meta_type = "ATFolder"
src_portal_type = "Folder"
dst_meta_type = "ATBTreeFolder"
dst_portal_type = "Large Plone Folder"

You can set the migration as “safe” or “unsafe”. A “safe” migration is a migration where the destination content type has equal/more fields than origin content type. You can also insert a warning message in description:

safeMigration = True
description = "Document to Document"

And than,in the __init__ method you must map source fields in destination fields. Basic archetypes fields are already mapped in BASE_AT_PROPERTIES:

self.fields_map = BASE_AT_PROPERTIES
At last insert this line to create a named utility::

<class name>Migrator = <class name>

In a zcml file register the new utility:

<utility
    component=".basemigrations.FolderToLargePloneFolderMigrator"
    provides="..interfaces.IContentMigrator"
    name="collective.contentmigrationui.FolderToLargePloneFolderMigrator"
/>

Changelog

0.1

  • Initial release

Metadata

Release files for collective.contentmigrationui 0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for collective.contentmigrationui 0.1
File Interpreter ABI Platform
collective.contentmigrationui-0.1-py2.4.egg Legacy Egg format - - Details

Release files / collective.contentmigrationui-0.1-py2.4.egg

Download URL collective.contentmigrationui-0.1-py2.4.egg
Size 52.1 kB
Tags Egg
SHA-256 checksum
How to use checksums
d3e239e841cff097d7e825c34bc8b44951812663afe7527731f559142bc8e89b
BLAKE2b-256 checksum
How to use checksums
f3e176da27b1ef6f74b01b51b37e99679c31164bc642fcfa81611694f516e8be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for collective.contentmigrationui 0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.1 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page