h2o
h2o

Reputation: 513

Converting Archetype Content to Folderish

I have an archetype content type that previously was not folderish. Now I have set it as folderish. What attribute or properties need to be changed so that any data created before can be migrated?

I have read the following documents:

Generic Setup Upgrade Steps

Converting one Content Type into another

I followed the above tutorial on upgrade steps but I do not know which attribute or properties to change.

Upvotes: 4

Views: 273

Answers (2)

johannes raggam
johannes raggam

Reputation: 21

i stumbled accross the same issue when trying to migrate non-folderish types to folderish ones based on: http://pypi.python.org/pypi/collective.folderishtypes

that helped: on a context to convert, call @@migrate-btrees view [1] to initialize the btree structure [2]. I assume your new Archetype content is plone.app.folder based.

[1] defined in: plone.app.folder.migration.BTreeMigrationView.

[2] Main work is done by: Products.BtreeFolder2.BTreeFolder2Base._initBtrees.

Upvotes: 2

Giacomo Spettoli
Giacomo Spettoli

Reputation: 4496

You could use Products.contentmigration. See it's doc to find out how to use it, it shouldn't be too difficult: just define your CustomQueryWalker and the mapping between your two content types. In order to find out what field you have to map, just put a pdb somewhere in the content's view and inspect the content schema.

similar question here: Migrating from (now obsolete) custom ATImage content type

Upvotes: 2

Related Questions