Migrating Liferay Document Library

Olaf Kock, modified 6 Years ago. New Member Posts: 3 Join Date: 8/30/19 Recent Posts
Hello, I have the need to migrate content from a portal created with liferay-portal-6.1.0-ce-ga1.
I investigated and found that the attachments are in JCR:
##
## Document Library Portlet
##
dl.store.impl=com.liferay.portlet.documentlibrary.store.JCRStore

and
&nbsp; &nbsp; &nbsp; &nbsp; <filesystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem">
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<param name="driver" value="com.mysql.jdbc.Driver">
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<param name="url" value="jdbc:mysql://localhost:3306/lportal_61_BGA1?useUnicode=true&amp;characterEncoding=UTF-8&amp;useFastDateParsing=false">
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<param name="user" value="root">
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<param name="password" value="Admin">
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<param name="schema" value="mysql">
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<param name="schemaObjectPrefix" value="J_FS_${wsp.name}_">
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;</filesystem>


In the mysql database, the are two tables with more than 30GB each:
  • j_v_pm_binval
  • j_pm_liferay_binval
These tables have the content of the files, i already confirmed this part
These two tables have two fields:
  • BINVAL_ID
  • BINVAL_DATA
The BINVAL_ID column has values like 0003dd66-65a5-4473-a10d-a910b5326262/{http://www.jcp.org/jcr/1.0}data[0] and the BINVAL_DATA has the content of the file in hexadecimal.
The is another table that has important info about the files (the fileentreyid, folderid, extention, mime type, title, etc):
  • dlfileentry
This table has a GUID and an int (fileentryid) has a primary key mas i can't find the relation with the other two tables.
Can anyone help me with this? I don't have any experience with liferay or jackrabbit or even with... java... I'm a PHP developer who ended up with this migration, can you help me out?Thank you in advance
thumbnail
Olaf Kock, modified 6 Years ago. Liferay Legend Posts: 6441 Join Date: 9/23/08 Recent Posts
Nuno Silva:

Hello, I have the need to migrate content from a portal created with liferay-portal-6.1.0-ce-ga1.
Migrate to where/what?
Liferay's database contains the Metadata, and the Jackrabbit tables, that you found, contain the binary data of documents. Just processing the raw tables doesn't look good to me, because you'll miss the metadata - that's why I'm asking what you migrate the data to.
If you upgrade Liferay (because 6.1 is quite old), you can just migrate to one of the other storage adapters that newer versions of Liferay continue to support. This migration assistant is built-in.
If you upgrade to another system, maybe that's still the easiest, if you migrate the content to one of the file-based storage adapters. At least then you'll have the raw files on disk individually.
Nuno Silva, modified 6 Years ago. New Member Posts: 3 Join Date: 8/30/19 Recent Posts
Hello, thank you for your reply


We are creating a new portal that doesn't use liferay, it's based in PHP (symfony).

We don't have any liferay background, or even java... so  we are a bit "scared" to upgrade the current portal (witch is still currently in use) to new versions, expecially because the portal is customized and the team that developed it is not availablle.

The current portal (liferay) will be in use until the day we finish the new (PHP) version. We need to migrate the attachments used in the current version to the new version so the users don't loose the info they created in the current portal.


When you say that we will loose, metadata, are you refering to info like size, file type etc? that info is also on a table.


Thank you again
thumbnail
Christoph Rabel, modified 6 Years ago. Liferay Legend Posts: 1555 Join Date: 9/24/09 Recent Posts
It depends on your usecase, but maybe Webdav could be useful.
You can access the Liferay document library using the Webdav protocol (note: it might be disabled in your configuration, but it is usually enabled). I am not sure about the UI of Liferay 6.1, but in the document library there should be a button/menu entry "Access from Desktop" or something like that. Or when you click on a document there should also be a Webdav url somewhere.
Using Webdav you can copy the files as a folder tree. You lose some metadata doing this like when the file was uploaded. And versions. But maybe that's sufficient for you.

Another idea: In the Server Administration there should be a dropdown/button somewhere that allows you to change the storage adapter (I hope it is actually there, there are so many Liferay versions with different features, but I think, 6.1 allowed you to do that). You absolutely need to backup the system and do this on a backup!! But with that button you can migrate everything to the filesystem. The files will then be placed named with version numbers in a folder structure like /groupId/folderId/fileEntryId.