Skip to main content

A generic content migration framework for Plone.

Project description

Content migration utilities by Martin Aspeli <optilude@gmx.net>

Released under the GNU Lesser General Public License (LGPL) version 2.0

This is a generic content migration framework, which should help you write your own content migrations. It has no UI and no value on its own, but makes it easy to write certain type of content migrations.

This replaces the ATContentTypes migration framework, and provide three useful extensions:

  • A CustomQueryWalker can be used to specify a more specific catalog query for a walker to use (e.g. which content to actually migrate). This can be used with any migrator.

  • A BaseInlineMigrator is similar to BaseMigrator, but does not migrate by copying the old object to a temporary location, creating a new object and applying migration methods. Instead, migration methods are applied in-place. This simplifies the code significantly, because attributes, local roles etc. does not need to be copied over.

    Note that whereas BaseMigrator works in terms of self.old and self.new as the objects being migrated, BaseInlineMigrator only has a single object, stored in self.obj. This can be used with any walker.

  • An extension of this class called FieldActionMigrator uses the action-based migration framework for Archetypes fields, found in field.py. Please refer to that file for full details, but briefly, you specify a list of attributes to migrate at the storage level, instructing the migrator whether to rename, transform, unset or change the storage for an attribute.

Please see the docstrings in walker.py, migrator.py and field.py for full details. For examples, see tests/cmtc.py and tests/testATFieldMigration.py.

Changelog

1.1 - 2009-03-05

  • Add missing imports in various places. [wichert]

  • Fix a bug in the permission migration logic, which caused the Manager role to gain all permissions. [ivo, wichert]

1.0 - 2008-09-17

  • Update documentation to fit the code. [pbugni]

  • Modify CatalogWalker to root the search at the portal passed in. This makes it possible to only migrate in parts of a site. [wichert]

  • Correct path handling, cleanup classifiers, make short description short. [wichert]

  • Use standard naming convention for the contentmigration package. [wichert]

  • Be more graceful with schema mismatches. [wichert]

  • Replaced deprecated transaction.commit(1) with transaction.savepoint(optimistic=True). [stonor]

1.0b4 - 2007-06-11

  • Add import for os so egg can be built. [derek_richardson]

  • Added missing configure.zcml. [witsch]

  • Reorganize contentmigration trunk for eggification. If you are using the trunk as a product, pin to the previous revision or change your external to use src/Products/contentmigration. [derek_richardson]

  • First eggified release.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Products.contentmigration-1.1.zip (41.1 kB view details)

Uploaded Source

File details

Details for the file Products.contentmigration-1.1.zip.

File metadata

File hashes

Hashes for Products.contentmigration-1.1.zip
Algorithm Hash digest
SHA256 cd0a095974aaff70554c2f92606132dd2f264cd4d9dbf4221c9a0799379264ea
MD5 2cca0d845e07f00a5e6058723bcdb452
BLAKE2b-256 e956f6dca88880245a6cca0ee71958043aeec2fb43c764749e5cc68f5a302200

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page