Changeset 886
- Timestamp:
- 05/15/12 12:55:56 (12 months ago)
- Location:
- Products.ecmigration/trunk/Products/ecmigration
- Files:
-
- 5 edited
-
MigrationTool.py (modified) (4 diffs)
-
migrate.py (modified) (2 diffs)
-
www/ecmigration_export.zpt (modified) (1 diff)
-
www/ecmigration_import.zpt (modified) (1 diff)
-
www/ecmigration_overview.zpt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
Products.ecmigration/trunk/Products/ecmigration/MigrationTool.py
r862 r886 1 # -*- coding: us-ascii -*-1 # -*- coding: us-ascii -*- 2 2 # _______________________________________________________________________ 3 3 # __________ .__ … … 38 38 from Products.PageTemplates.PageTemplateFile import PageTemplateFile 39 39 from Globals import InitializeClass 40 from migrate import ECMigration 40 from migrate import ECMigration, getBaseDirectory, getLogDirectory 41 41 import os 42 42 … … 62 62 security.declareProtected(ManagePortal, 'manage_import') 63 63 manage_import = PageTemplateFile(os.path.join('www','ecmigration_import'), globals()) 64 64 65 security.declareProtected(ManagePortal, 'manage_export') 65 66 manage_export = PageTemplateFile(os.path.join('www','ecmigration_export'), globals()) 67 68 def getBaseDir(self): 69 return '%s' %getBaseDirectory(create=False) 70 71 def getLogDir(self): 72 return '%s' %getLogDir() 66 73 67 74 security.declareProtected(ManagePortal, 'importFilenames') … … 85 92 """ Export content from eduCommons """ 86 93 mig = ECMigration(self.portal_url.getPortalObject()) 87 mig.exportContent() 94 results = mig.exportContent() 95 if REQUEST: 96 REQUEST['export_results'] = results 88 97 if REQUEST: 89 98 REQUEST.response.redirect('manage_overview') -
Products.ecmigration/trunk/Products/ecmigration/migrate.py
r862 r886 96 96 # Migration logging 97 97 98 def getBaseDirectory( ):98 def getBaseDirectory(create=True): 99 99 """ Get the base directory for migration files """ 100 100 try: … … 103 103 cwd = os.getcwd() # needed for eduCommons 4.0.0 104 104 basedir = os.path.join(cwd, 'migration') 105 if not os.path.exists(basedir): 106 os.mkdir(basedir) 105 if create: 106 if not os.path.exists(basedir): 107 os.mkdir(basedir) 107 108 return basedir 109 110 def getLogDirectory(): 111 getBaseDirectory(create=False) 112 base = getBaseDirectory() 113 return os.path.join(base, 'ecmigration.log') 108 114 109 115 def setupLogging(logger): 110 116 """ Set up logging for the migration """ 111 base = getBaseDirectory() 112 logfn = os.path.join(base, 'ecmigration.log') 117 logfn = getLogDirectory() 113 118 handler = logging.FileHandler(logfn) 114 119 logfmt = logging.Formatter('%(asctime)s %(levelname)s %(message)s') -
Products.ecmigration/trunk/Products/ecmigration/www/ecmigration_export.zpt
r824 r886 3 3 tal:replace="structure context/manage_tabs">Tabs</h2> 4 4 5 <p>Export content to be migated to a newer version of eduCommons.</p> 5 <p>Export content from this site to be migated to a newer version of eduCommons.</p> 6 <p>Content will be exported to following directory:</p> 6 7 8 <blockquote tal:content="context/getBaseDir">/some/path/migrate</blockquote> 9 10 <p>This may take a long time, depending on the amount of content in the site. Please ensure that there is adequate disk space in the above location for your site's content before exporting.</p> 7 11 8 12 <form action="exportContent" method="POST"> -
Products.ecmigration/trunk/Products/ecmigration/www/ecmigration_import.zpt
r862 r886 5 5 <p>Import migrated content from a previous version of eduCommons.</p> 6 6 7 <p style="color:red">WARNING: This action will alter the current contents of your site!! If you are importing into a current production site, be sure that you have backed it up before continuing.</p> 8 9 <p>Content will be imported from the following directory:</p> 10 11 <blockquote tal:content="context/getBaseDir">/some/path/migrate</blockquote> 12 13 <p>Please be sure that exported content is copied to the above directory before proceeding.</p> 14 7 15 <form action="importContent" method="POST"> 8 16 <input type="submit" value="Import Site"/> 9 17 </form> 10 18 <!-- 11 19 <form action="importFilenames" method="POST"> 12 20 <input type="submit" value="Import Filenames Only" /> 13 21 </form> 14 22 --> 15 23 <h1 tal:replace="structure context/manage_page_footer">Footer</h1> -
Products.ecmigration/trunk/Products/ecmigration/www/ecmigration_overview.zpt
r792 r886 5 5 <p>This tool is used to migrate older versions of eduCommons to the latest current version. The tool creates a directory structure under the <em>var</em> directory in your eduCommons instance.</p> 6 6 7 <h3>Exporting</h3> 8 9 <p>Use the "Export" tab to export the content in this version of eduCommons for use in a future version of eduCommons.</p> 10 11 <p>The path where migrated content will be written will be listed on the export page.</p> 12 13 <p>Once the export is complete, create an archive of the exported files by using the following: 14 15 <blockquote> 16 cd <em>(path to migrated content)</em><br /> 17 tar -zcvf migrated_content.tgz . 18 </blockquote> 19 7 20 <h3>Importing</h3> 8 21 9 <p>Use the importtab to import content from a previous version of eduCommons into this instance.</p>22 <p>Use the "Import" tab to import content from a previous version of eduCommons into this instance.</p> 10 23 11 < h3>Exporting</h3>24 <p>Before importing be sure that the exported content is located in the correct directory on the server. This directory is listed on the import tab. Also, if you have copied the exported content as a file archive, you will need to unarchive the content before importing.</P> 12 25 13 <p>Export the content in this version of eduCommons for use in a future version of eduCommons.</p> 26 <blockquote> 27 cd <em>(path to import directory)</em><br /> 28 tar -zxvf migrated_content.tgz 29 </blockquote> 14 30 31 <p>Also make sure that your current eduCommons instance has permission to read the files once they are unarchived. 32 33 <blockquote> 34 cd <em>(path to import directory)</em><br /> 35 chown -R zope * 36 </blockquote> 15 37 16 38 <h1 tal:replace="structure context/manage_page_footer">Footer</h1>
Note: See TracChangeset
for help on using the changeset viewer.
