Child pages
  • Upgrading from 1.2.x or prior to 2.0.0
Skip to end of metadata
Go to start of metadata

Overview

The data representation of attachments (which is a part of the SimpleContentPortlet) changed from a Base64-encoded text field in v1.2.x and prior to a BLOB column in v2.0.0.  Users of v1.2.x and prior must do the following procedure to export the data from the attachments tables, then re-import it with v2.0.0 or later to migrate the prior attachment data into the BLOB column.  Also with v2.0.0 the logging was changed from log4j (log4j.properties) to logback (logback.xml) so you will need to update your uportal-portlets-overlay/SimpleContentPortlet accordingly.

General steps:

  1. Export the existing data using the 1.2.x version of the portlet
  2. Import the saved data using the 2.0.0+ version of the portlet
  3. Update the version of the portlet you are deploying. Also update from log4j to loback for logging.

Migration steps

  1. Clone the SimpleContentPortlet from https://github.com/Jasig/SimpleContentPortlet. You can do this on your target system (e.g. production) or on a system that has access to the target (e.g. production) database.

  2. Modify src/main/resources/hibernate.properties to refer to your current database.  Refer to the values in your uPortal filters/<environment>.properties file.

    src/main/resources/hibernate.properties
  3. From the root of the SimpleContentPortlet source, export the existing data.

  4. Checkout the latest version of the SimpleContentPortlet

  5. IF you have negative sequence ID values, possible on at least Oracle and PostgreSQL databases exhibiting issue  CMSPLT-54 - Attachment uploads fail with PostgreSQL 9.3 Resolved

    1. Using your database tools, back up the tables SCM_ATTACHMENT and sequence UP_ATTACHMENT_SEQ
    2. Drop tables SCM_ATTACHMENT and sequence UP_ATTACHMENT_SEQ

  6. From the root of the SimpleContentPortlet source, import the exported data.  The database column will be created if it is not already present (if the new portlet is deployed to uPortal, that will also create the new column).

  7. Update your uPortal pom.xml to use the latest released 2.0.0+ version (see http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.jasig.portlet.simplecontent%22 for latest version).  Alternately for steps 7 and 8 you can cherry-pick https://github.com/Jasig/uPortal/commit/afeb7366caf02f607066f752158f1aa3bae47cd0.

  8. (within uPortal) Update your uportal-portlets-overlay/SimpleContentPortlet to switch from log4j.properties to loback.xml by putting this logback.xml into uportal-portlets-overlay/SimpleContentPortlet/src/main/resources.  With uPortal master, the uportal-portlets-overlay/SimpleContentPortlet/pom.xml already includes filtering logback.xml as part of the maven build process.  Also delete uportal-portlets-overlay/SimpleContentPortlet/src/main/resources/log4j.properties.
  9. Deploy your uPortal (ant deploy-ear).  Test and insure you are able to view the existing attachments, and can upload and view new attachments.

    Icon

    Insure on your target server that <tomcatHome>/webapps/SimpleContentPortlet/content is empty before performing your test of accessing existing attachments. That directory is the location the portlet hydrates files from the database onto the hard disk to avoid database accesses for subsequent attachment accesses. The directory should be empty as a result of deploying the portlet. If there are remaining files in the directory, these will be served instead of accessing the database and you may have a false sense that the export/import worked correctly when it had not.

    Also clear your browser cache to insure content is not served from the browser's local cache.

  10. (optional but recommended) Drop the extraneous column SCM_ATTACHMENTS.DATA.  This column held the Base64-encoded version of the attachments, but is now replaced by the column BDATA.
  • No labels