Migration from Jahia 3.1.4 to Jahia 4.0 --------------------------------------- WE STRONGLY RECOMMEND THAT YOU MAKE A BACKUP OF YOUR DATABASE AS WELL AS YOUR JAHIA INSTALLATION BEFORE YOU BEGIN THE UPGRADE PROCESS, AS THE MIGRATION TOOL WILL MODIFY THE JAHIA PROGRAM, DATABASE SCHEMA AND CONTENT DURING THE PROCESS. IF THE MIGRATION FAILS, YOU WILL NOT BE ABLE TO RESTART YOUR JAHIA 3.1.4 !!! IT IS EVEN BETTER TO TRY THE MIGRATION ON A BACKUP COPY OF YOUR SITE AND DATABASE BEFORE ANY ATTEMPT TO MIGRATE A PRODUCTION SERVER. If you have any problems or questions regarding the migration process, please use the install_list@jahia.org mailing-list. A few steps are needed in order to upgrade your Jahia 3.1.4 to Jahia 4.0. Basically, the migration can be completed in 3 steps: 1) Migration of the Jahia program, database structure and content 2) Update of the templates 3) Migration to the new filemanager system (WebDAV) This readme will help you complete these 3 steps. 1) Migration of Jahia, database structure and content ----------------------------------------------------- a) Copy the JahiaPatch_4_0.jar file to the TOMCAT_HOME/webapps/jahia directory of your Jahia 3.1.4 b) Make sure tomcat is stopped and that the database is running and available c) run the migration patch by typing the following command : java -jar JahiaPatch_4_0.jar This will deploy the Jahia program. Old files will be renamed with a "3_1_4" extension. Once the migration is successfull, you can delete these files. The migration patch will also connect to the database to add new tables and change the structure of some tables. As Jahia 4.0 support multilingual sites, you will need to choose during migration the language of each virtual site, either one by one or for all virtual sites at the same time. d) If no errors occur, the migration patch should display an "Update successfull" message. You have completed the first step of the migration. e) After applying the patch, you need to remove an old library from /WEB-INF/lib: lucene-1.2*.jar f) Your Jahia is now migrated, but the Tomcat which was packaged with your Jahia 3.1.4 is an older version (4.1.12 or 4.1.18) As Jahia 4.0 is packaged with Tomcat 4.1.27, you should replace the old version by this one. We suggest that you do the following: i) Make a new Jahia 4.0 install and shutdown Jahia. ii) Remove all directories in the tomcat/webapps of your new Jahia 4.0 install iii) Copy the content of the tomcat/webapps of your migrated Jahia to the same directory of your fresh install iv) modify in the jahia.properties the "serverHomeDiskPath" parameter to reflect the correct path of your install. 2) Update of the templates -------------------------- There is not much changes needed in order to allow your templates to work on Jahia 4.0. You can later modify them to use new features of Jahia 4.0, but the following changes are needed in order to allow the old templates to run without errors: a) replace getValue() and getObject() methods Old 3.1.4 API: getValue() getObject() New 4.0 API: getFieldValue() getFieldObject() Example with 4.0 API myContainer.getFieldValue(myField,"") myContainer.getFieldObject(myField) b) replace getURL() / getUrl() / getPagePath() / getHomePage() methods Old 3.1.4 API : getURL() getURL() getPagePath() getHomePage(); return JahiaPage New 4.0 API: getUrl(ParamBean jParams) getURL(ParamBean jParams) getPagePath(String operationMode, JahiaUser user) getContentHomePage(); return org.jahia.services.pages.ContentPage Example with 4.0 API: linkPage.getUrl(jData.params()) linkPage.getURL(jData.params()) getPagePath(jParams.getOperationMode(),jParams.getUser()) jData.gui().getContentHomePage().getID() c) Replace ContainerSorterBean and ContainerFilterBean constructors for filters. If you are using filtering or sorting capabilities in your templates, you need to modify these 2 constructors: Old 3.1.4 API : Constructor public ContainerSorterBean(...) Constructor public ContainerFilterBean(...) New 4.0 API: Constructor public ContainerSorterBean(..., EntryLoadRequest loadRequest) Constructor public ContainerFilterBean(..., EntryLoadRequest entryLoadRequest) Example with 4.0 API: sorterBean = ContainerSorterBean(listID, "myField", jParams.getEntryLoadRequest()) filterBean = ContainerFilterBean("myField", jParams.getEntryLoadRequest()) d) Top bar admin menu The new admin bar includes new features in regards to multilingual, validation and other new features. A basic admin_menu.jsp is provided with this package. If you use the corporate templates, you can replace the old admin_menu.jsp by the new one. Please not that it does not contain all the "rings and bells" of the admin_menu.jsp provided with the new corporate templates, but it should allow to get you started. e) Sitemap As a new sitemap engine has been added, you will need to replace your sitemap file. You can use the sitemap.jsp provided with this package or the one provided with the Jahia 4.0 installation package. You will just need to replace the sitemap.jsp which is in the "include" directory. f) Search results As you can now also search in PDF documents, search results may also be linked to a document, so the following test needs to be done when displaying results: <% if ( thisHit.type != FieldTypes.FILE ){ %><%=thisHit.teaser%>...<% } else { %><%=thisHit.teaser%>... <% } %> 3) Migration to the new filemanager system (WebDAV) --------------------------------------------------- You can now launch your migrated Jahia. If you have made all the required modifications, you should see your site as it was on Jahia 3.1.4. However the images and files uploaded through the Jahia filemanager will not be displayed. As Jahia now use a new WedDAV filemanager system instead of the old one, you will need to migrate from the old to the new system. To start the filemanager migration, proceed to the following : a) login to Jahia as SuperAdmin (root, or whatever username you chose for the SuperAdmin of the server) b) switch to edit mode c) enter the following URL : http://localhost:8080/jahia/Jahia/engineName/filemanager/op/edit/pid/1?screen=migrate Replace the "localhost:8080" part if you are not working on the machine where Jahia is installed, and if Jahia is running on another port that the standard 8080. If your home page is not the pid 1, replace also the "pid/1" with the correct id of the home page. This will start the file migration. All files will be copied from the "jahia/WEB-INF/content/filemanager/VitualSiteName" directory to the "jahia/WEB-INF/content/slide/VitualSiteName/shared/import" directory. A new directory will be created here for each page containing files, with the name of the page as directory name. If files are present in the filemanager and not used on any pages of the site, they will be copied to an "unused" directory. Please note that depending on the number of files present in the filemanager, the migration process can be lenghty, so do not try to refresh or close your navigator before the "Migration result" screen is displayed. d) once the file migration is over, you can browse your site and check that images and files are now available. A side note: The webapps provided with a new install of Jahia 4.0 have been refactored and now include OJB support, which means you can use another database than the embedded Hypersonic. There is currently no migration procedure if you want to migrate your data from a old webapp to the new version. This procedure should be available shortly.