Migrate Liferay Database TO HSQL - liferay

on the web there are many resources about exporting a development database (HSQL) into a production one (eg. MySQL), but I need to move data in the opposite way.
I usually use the Liferay embedded function to export data to a new database, but it needs for a running database server instance (and it seems to be impossible using HSQL).
Does a way to achieve this goal exist in Liferay 6.2?
Thanks

Go to Control Panel / Server Administration / Data Migration. You can give the standard HSQL URLs - you don't need a running HSQL server. The standard HSQL parameters can be found in Liferay's portal.properties under Hypersonic

Related

Prevent developers from modifying Liferay Database structure

I am working in an environment that contain many Liferay Newbies along with experts, now I want to make some configuration to prevent any one from modifying the structure of the Liferay Database, i.e. one developer started a liferay 6.2 server while connecting to a Liferay 6.1 configuration database causing the database to get corrupted ... I know that I can't make LR users read-only because any change is reflected to the database, but I want to put some limitations to prevent a scenario like the above.... is any related configuration available ?
Regular permissions that are required for accessing Liferay's database are SELECT, INSERT, UPDATE and DELETE. Only when you're developing new plugins you need CREATE TABLE, ALTER TABLE, CREATE INDEX and similar DDL permissions on the database you're developing on. Just don't give them the full permissions.
Update routines (that run when you have 6.2 code running on 6.1 structures) will require the DDL permissions or fail. And, of course, you can also remove / unconfigure the Upgrade routines.

Liferay create site / page programmatically

I have been using Liferay for work for 2 weeks. I noticed that it's a bit difficult to find good documentation and tutorials.
Until now I created pages from the web portal. After I create them, I drag and drop portlets. I don't really like this approach, I would prefer to use a coding approach. Is there a way to create a website or page programmatically by defining a project as I do to create portlets?
Moreover, I am using Liferay with WebLogic 10.3.6. I want to know where liferay puts pages I created via web-portal on the file system. I suppose that a file, or something similar, is created when I declare a new site on the Liferay web-portal.
Thank you all,
Marco
Yes Liferay has it's Database, all data of any Liferay object is stored in the database and / or on the file system depending on your configuration.
However, one of the functionality of Liferay is to let you create pages / sites through the UI. As documented in the Java Portal Specification and Liferay Server Documents your approach to create pages in an alternative way is possible but it is part of Liferay's Portal Services. You can use Liferay's Service (HTTP REST) API to call the related service. To access those APIs you need to configure your Liferay Server.
In case you want to do programmatically you still need to configure, enable and call those external HTTP services from your code. You should not create Liferay Objects from your own code hosted as an extension inside your Liferay Instance as that will result inconsistency in your Liferay Database / filesystem. (As in case of page creation Liferay creates a set of other related objects in it's database / filesystem.)
In your liferay bundle you will find two plugins of interest.
First is resources-importer-web for which description says
The Resources Importer app allows front-end developers to package web
content, portlet configurations, and layouts together in a theme
without saving it as a compiled .LAR file thereby allowing for greater
flexibility in its usage between Liferay Portal versions.This app will automatically create associated content when other
plugins are deployed that are configured to make use of the Resource
Importer app.This app installs as a Liferay service.
Second is welcome-theme which declares resources to be created by resources-importer-web. This on should be example how to create your own. Take a look at
welcome-theme\WEB-INF\src\resources-importer\*
welcome-theme\WEB-INF\liferay-plugin-package.properties
This feature is described at importing-resources-with-themes
As mentioned by gabor_the_kid, Liferay stores all objects in its tables. For example, User related objects would be in user table. Liferay exposed services or API's to change the default/to add new behaviors by program but not easier than achieving it through UI. Also maintenance should be considered for going program way of creating pages or layouts etc.
You can describe your changes using xml and use the Liferay Portal DB Setup core to create the changes in DB.
The library defines the list of available xml configurations.

Has anyone found or developed a good couchdb manager in node-js?

I would like to manage my couchdb with a good-looking nodejs manager.
It should have these functions:
Create document.
Delete document.
Dump the whole Database
Backup the whole Database
Futon, the built-in manager has all the functionality you require. Futon has a web interface and can be accessed by running couchdb and then pointing your web browser to http://localhost:5984/_utils/

How to switch jackrabbit persistence from filesystem to database?

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...
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
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.

Extracting Metadata of Lotus Notes Applications Using Notes Java API?

I am looking for extracting metadata about Notes Applications on a Domino server using Java Notes API. I tried reading the list of applications/databases from catalog.nsf file.
But catalog.nsf does not have new Applications that are created based on a existing template.
So From where can I get the list of applications that are existing on a Domino Server? Will the new Applications be added to catalog? If not how to make them to be added in the catalog?
Any help or Ideas will be much appreciated.
Thanks,
Srinivas
So if you want to do this in Java If the catalog.nsf is not upto date, then you can also try the dbdirectory class, look ==>here.
This should have an example to give you an idea how to read through all database on the server. If the Domino server is not registering new applications then catalog process is not running. You can load it by simply type "load catalog" at the console. More details ==>here.
There can still be other issues, but will wait for your response.
This is more of a "Server Fault" answer, but in the Domino Directory, you can turn on the Domain Catalog server task for a server in your domain, and that server will populate (and keep updated) the catalog.nsf file, which will then replicate across your domain.
So just enable that task within the server document, or go to the domino console and type load catalog

Resources