Foren

DXP: Migrate to Document DB Store

Zak Thompson, geändert vor 7 Jahren.

DXP: Migrate to Document DB Store

Junior Member Beiträge: 70 Beitrittsdatum: 13.06.16 Neueste Beiträge
I am currently in the process of setting up a development environment for DXP, and I'm running into some issues with using the database as the document store. We want to use the DB store for development only to help maintain consistency, and will be using the normal file system storate for prod. The current setup is the prod environment, a remote dev server, and a shared database for local development. We are on the latest fix pack of DXP and MariaDB 10.1.

I was able to successfully migrate the remote dev server to using the document DB store by using the following steps:
  • Point the portal at a local copy of the document library copied from prod
  • Run the data migration from server administration to migrate the documents into the DB
  • Add "dl.store.impl=com.liferay.portlet.documentlibrary.store.DBStore" to the portal-ext and restart the server


Everything is working great now on the remote server, and when the homepage is refreshed the documents load correctly. I deleted the local copy of the document library to ensure that it was indeed using the documents from inside the DB, and the documents still load correctly.

For the shared database for local development:
  • Use mysqldump to take a snapshot of the remote local dev DB with the documents in the library
  • Source the snapshot into a new table for shared local dev
  • Add "dl.store.impl=com.liferay.portlet.documentlibrary.store.DBStore" to the portal-ext in my local liferay workspace and restart the server


However, when the homepage is refreshed, I now get the following exceptions:
[ImageImpl:69] Error reading image 53451
java.lang.IllegalStateException: Store is not available
	at com.liferay.portlet.documentlibrary.store.StoreFactory.getStore(StoreFactory.java:125)
	at com.liferay.portlet.documentlibrary.store.DLStoreImpl.getFileAsStream(DLStoreImpl.java:288)
	at com.liferay.document.library.kernel.store.DLStoreUtil.getFileAsStream(DLStoreUtil.java:383)
	at com.liferay.portal.model.impl.ImageImpl.getTextObj(ImageImpl.java:60)
	at com.liferay.portal.webserver.WebServerServlet.getImageBytes(WebServerServlet.java:502)
	at com.liferay.portal.webserver.WebServerServlet.writeImage(WebServerServlet.java:1262)
	at com.liferay.portal.webserver.WebServerServlet.service(WebServerServlet.java:300)...


I tried adding the dl.sotre.impl line to all of the portal-ext's under the configs in the liferay workspace to ensure it was picked up, but I still get the exceptions.

Am I missing a step or steps that need to be performed in order to have my local instance recognize that it should use the DB store? Or is this a bug, and should I report it to Liferay Issues?
thumbnail
David H Nebinger, geändert vor 7 Jahren.

RE: DXP: Migrate to Document DB Store

Liferay Legend Beiträge: 14919 Beitrittsdatum: 02.09.06 Neueste Beiträge
You can't really just switch over mid-stream. Liferay will still think documents that were in the filesystem are still available. Under 6.2 (and earlier) there was an option in the control panel to help with the change over, but I'm not sure if it still exists for DXP or not.
Zak Thompson, geändert vor 7 Jahren.

RE: DXP: Migrate to Document DB Store

Junior Member Beiträge: 70 Beitrittsdatum: 13.06.16 Neueste Beiträge
Hi David,

I think the issue was the use of the wrong impl due to documentation on the Liferay Developer Network being out of date.

I was originally referencing this article on upgrading to the document DB store, so I used the "dl.store.impl=com.liferay.portlet.documentlibrary.store.DBStore" mentioned in the article.

I was digging through the portal.properties on github and saw that "dl.store.impl=com.liferay.portal.store.db.DBStore" was listed in the portal.properties as the way to enable to the db document store.
I switched to "dl.store.impl=com.liferay.portal.store.db.DBStore" in my portal-ext.properties and everything works correctly now.
thumbnail
Alberto Chaparro, geändert vor 7 Jahren.

RE: DXP: Migrate to Document DB Store

Liferay Master Beiträge: 549 Beitrittsdatum: 25.04.11 Neueste Beiträge
Hi Zak,

The issue has been already solved but we are pending to publish the documentation.

Thanks!