2

I have a Liferay portal that was configured to use filesystem persitence for jackrabbit.

It seems like this persistence mode creates a lot of files on the filesystem (so far something like 113'000) and I'm slowly reaching the file count quota of the server.

I would like then to switch to database persistence. I know how to configure it but I don't know how to migrate the existing content.

Exporting and importing the various libraries (document, images, etc.) sounds like a lot of work and very error-prone, especially because it's a multi-homed deployment. Plus, I don't know if it will recreate the same exact URL for the documents, which is important to me.


Short update:

I managed to upgrade to Liferay 6. There is however no way to migrate the jackrabbit data from file system to database from within Liferay; what the Data Migration panel offers is to migrate from jcr hook to another persistence hook.

My initial issue was not to have the data in a database but to reduce the number of files on the filesystem (quota limit). I then switched to the FileSystemHook.

Here is the file count number (find . | wc -l).

  • JCRHook: 107566
  • FileSystemHook: 2810.

Don't know why Jackrabbit creates so much files...

ewernli
  • 38,045
  • 5
  • 92
  • 123
  • Hi, have you found out the reason why there are too many files created with JCRHook ? I'm just trying to decide on the implementation, cause I will have a lot of files with a lot of mixin properties. So I'm afraid that if I choose jackrabit BundleFsPersistenceManager with localFileSystem, I could get into the same situation as you did – lisak Mar 17 '11 at 12:39

2 Answers2

3

There are several ways to migrate, most of them are documented in the Jackrabbit Wiki:

Export to XML may not work for large repositories, because it uses too much memory (you need to try). I have never used the other migration tools, so I can't comment on them.

Thomas Mueller
  • 48,905
  • 14
  • 116
  • 132
  • Thanks! I will give them a try. – ewernli Oct 28 '10 at 04:56
  • Short update: The RepositoryCopier comes only with jackrabbit 1.6 and I have an older version of jackrabbit. I tried to adapt it without success. As a last resort I will investigate the XML export/import. – ewernli Nov 07 '10 at 23:27
3

In Liferay 6, there is a new dedicated page in the portal administration that is intended to facilitate migrations like that. You have to log in as an administrator (omniadmin if you have multiple portal instances in your server)and go to the Control Panel. In the Server Administration pannel, click on the Data Migration menu and you will be offered to migrate from FileSystem to database.

It appears that you are not yet in Liferay 6 (Glassfish WebSpace Server is a Liferay 5.2), so there are several options :

  • upgrade the portal itself to from 5.x to 6.0.5, as explained in the Liferay Wiki and the use the migration page.
  • stay with your version, and create dedicated class inspired by the ones provided by Liferay in version 6
  • export the community pages (Liferay ARchive), create a new portal with DB persistance and import the pages and their content.

The migration would be my pick, either with the whole portal (but chances are that it's not something on your roadmap) or with ad hoc migration classes.

Arnaud

  • Thanks for the info. Will make a clone of the production environment locally to test the migration to 6.x. The problem is that we are still stuck to the old rights model of 4.x and from my experience upgrading is always time consuming, but so far I always succeeded one way or the other (My notes were here: http://bit.ly/92UFxF). Otherwise I think I will consider a low-level options. – ewernli Oct 28 '10 at 04:56
  • for the permissions, you have to start your portal first with permissions.user.check.algorithm=4, and then use the Data Migration menu : the upgrade of the permission check algorithm is one of the options. I totally agree with you on the time involved in the upgrade, and this new menu is a much welcome addition. – Arnaud Deslandes Oct 28 '10 at 13:14
  • Short update: I managed to install LR 6 locally and upgrade. Haven't done advanced test but seems to be working so far. The algo I have is `permissions.user.check.algorithm=2` back from the old time of LR 4.x! However, the data migration panel does work at the hook level. So it offers me to migrate the documents to FileSystemHook, S3Hook, and 2 others. But does not help to migrate the content of Jackrabbit (JCRHook) which is apparently a black box for Liferay...And for some unknown reason, it does not propose `com.liferay.portal.image.DatabaseHook` for the documents... – ewernli Nov 07 '10 at 23:31
  • I moved to `FileSystemHook` which dramatically reduced the number of files on the server. You get the green tick! – ewernli Nov 08 '10 at 11:38
  • Glad you are able to upgrade. You should see improvements in speed on pages with a lot of permission checks. also, you may be interested to move to the new theme : my users in charge of content creation prefer the new dock for example. – Arnaud Deslandes Nov 08 '10 at 20:51