How-To Migrate from PTK to CMF (New PTK)
How-To Migrate from PTK to CMF (New PTK)
Installation
Copy acl_users
1. To migrate users from the acl_users, download and install external method copy_users. If you have modified or used someother form of login manager, you'll have to deal with login management differently (one possible option is duscussed here).
-
a. The external method needs to be installed in your Zope/Extensions directory.
b. Open web browser to access the ZMI[1].
-
i. In the root of your Zope installation, add the external method from the products pull-down menu.
ii. Give it an id, set the module name to copy_users
iii. Set the function name to copyUsers
c. Create a DTML method which does something like the following:
Move Member Folders
2. To migrate Member folders from the source PTK install to the target CMF install, download and install the external method copy_folders.py. This method will move your member folders, ensuring both ownership and local roles remain intact (simply cutting and pasting these folders from one instance to another will change the ownership to the user who is doing the cutting and pasting).
-
a. The external method needs to be installed in your Zope/Extensions directory
b. Open web browser to access the ZMI
i. In the root of your zope installation, add the external method from the products pull-down menu.
ii. Give it an id, and set the module name to copy_folders
iii. Set the function name to copyFolder
c. Create a DTML method which does something similar to the following:
-
i.<dtml-call "copy_folder('/sourcePortal/Members','/targetPortal/Members')">
ii. View the newly created DTML method (this will run the external method, migrating all of folders in your Members folder to the new portal instance's Members folder).
Move Other Objects
3. To migrate other objects you've added to your portal, simply cut and paste these objects. Make sure you are logged into the ZMI as a user with management permissions. If you have folders which you need to move and retain ownership, you can use the external method copy_folders.py, passing the proper arguments as described above to suit your existing instance.
-
a. For example, to copy a Squishdot instance from the old PTK to our newly created CFM instance,
simply select the object, click copy, change to the new instance of the CFM and select paste.
Customizing Portal Skins
4. If you have modified the skin of the your portal installation, you will need to modify the skins to get your look and feel setup on the new portal instance. The following steps should give you a good idea about how to go about doing this in with the new skin features of the CMF. At the time of writing this document, the 'custom' skin folder was not automatically created with the new portal. In the current release, 'custom' is now automatically created for you, but the steps outlined below guide you through the process of adding additional custom skins.
-
a. In the new portal instance, select the PortalSkins from within the ZMI
b. Create a new folder named 'YourCustomName'.
c. Select Properties from the management tabs.
d. Add the new skin, with the path to the 'custom' directory you created above.
e. In the portal-skins/generic directory, select the skinnable element you which to modify. For our example we will use the index_html document.
f. A copy of the element is copied into your new custom folder, where you can now edit the element to your hearts content.
Customizing Stylesheets
5. Stylesheets have also been moved to the filesystem. The following steps walk you through this simple process.
-
a. Go into the generic skin, select the stylesheet_properties, and select customize.
b. To customize our default stylesheet properties and/or add new properties easily, simply edit the new stylesheet_properties in your custom skin directory.
Adding Custom DTML (Methods)
6. Adding custom DTML to your portal instances should change slightly to previous instances of the PTK. DC is taking the stand the additional DTML added to portal's is considered 'skin' material, and thus should not be in the root of the portal, but added to one of your custom skin directories (see above). As long as your DTML is in the path assigned to your custom skin, it will be found within the namespace.
-
a.In our sample portal, we have a DTML method which displays the most recent downloads added to the site (very similar to the recent news method).
We simply go into your custom skins directory, and create a new DTML method. We can then call this method from anywhere in the portal which uses the custom skin (or has custom in it's path, see the skins discussion above).
7. Adding a new product type to the portal.
-
a.Portal Types Tool
-
i. Select the portal types tool, and add new Content Factory Metadata.
ii. Give it an ID and the proper Metadata.
b. Add the new product python module to PTKDemo
c. Edit __init__.py
-
i. Import new module
ii. Add the product to the module_aliases, contentClasses, contentConstructors,
d. Add the web 'wizard forms' to PTKDemo/dtml folder.