RE: Is there any thoughts on how to automate site LAR exports and imports

thumbnail
William Gosse, modified 7 Years ago. Liferay Master Posts: 533 Join Date: 7/4/10 Recent Posts

I know has the remote pub stuff for each individual site but that still has to be manually performed from within the portal itself.  I could almost live without the automated exports but the imports would be great to have for continuous build, test and deploy operations.

thumbnail
David H Nebinger, modified 7 Years ago. Liferay Legend Posts: 14933 Join Date: 9/2/06 Recent Posts

I believe if you drop the lar in the deploy folder it will get picked up.

thumbnail
William Gosse, modified 7 Years ago. Liferay Master Posts: 533 Join Date: 7/4/10 Recent Posts

Maybe I need to clarify this a little. I'm talking about a site LAR exported from an existing portal.  I've always thought that they need to be manually imported new site.

thumbnail
David H Nebinger, modified 7 Years ago. Liferay Legend Posts: 14933 Join Date: 9/2/06 Recent Posts

Yeah, I never try to rely on these, and I think you're right about the site import.

I've always found the lar import to be pretty "fragile" in that at least for me everything has to be practically perfect to get one to load.

Clients who ask me about using lar export/import for "promotion" I always counsel against relying on that because the differences between the environments can pose problems.

Heck, I even wrote a whole blog about the lars: https://community.liferay.com/blogs/-/blogs/content-creation-is-not-a-development-activity-

thumbnail
William Gosse, modified 7 Years ago. Liferay Master Posts: 533 Join Date: 7/4/10 Recent Posts

LF7 seems to be better then previous versions at importing LARs. Yes I agree LF6+ was very sketchy and often failed to perform an import correctly.  I'm not seeing that in LF7 at all. Imports seem to work reliably.

thumbnail
William Gosse, modified 6 Years ago. Liferay Master Posts: 533 Join Date: 7/4/10 Recent Posts
I still find it hard to believe that there aren't better tools in Liferay to automate importing of site lars.  We using in docker where the construction of the containers happens on the fly using stuff pulled from GIT. For most things, wars, that's fine.  For the stuff in Liferay's database its not so fine. We've decided just to dump the db, in our case postgres, from a staging instance and check into GIT along with the corresponding data folder. Then we actually tweak the SQL in some case's such as configuring an authentication plugin as part of the docker deployment. Not really liking this but I haven't found a better way yet.  I feel in the age of containerization Liferay presents some challenges. I'll happily admit I could be wrong with this opinion.
thumbnail
David H Nebinger, modified 6 Years ago. Liferay Legend Posts: 14933 Join Date: 9/2/06 Recent Posts
Actually for this case I'd recommend either using Resource Importer (deprecated), the newer Site Initializers, and even groovy scripts can be an option.
thumbnail
William Gosse, modified 6 Years ago. Liferay Master Posts: 533 Join Date: 7/4/10 Recent Posts
Resource Importer, Site Initializers,? I'm familar with either of these tools. Is there documentation available for either of them I'm still on 7.0 GA7 so does that make any difference. You know I've Googled the heck out of this topic and these are new to me.  Thanks David.
thumbnail
David H Nebinger, modified 6 Years ago. Liferay Legend Posts: 14933 Join Date: 9/2/06 Recent Posts
Resource importer for 7.0 still works more or less the same as it did for previous versions; even if you find only doco for earlier versions of Liferay, it still operates in a similar fashion.  https://dev.liferay.com/en/develop/tutorials/-/knowledge_base/7-0/importing-resources-with-a-theme

Site initializers are the newer option, meant to replace the RI, but they have yet to be officially documented: https://issues.liferay.com/browse/LPS-83770

This ticket has value in that it points to three sample themes which use the site initializer. 
thumbnail
William Gosse, modified 6 Years ago. Liferay Master Posts: 533 Join Date: 7/4/10 Recent Posts
Also how are groovy scripts used to initialize Liferay?  Is there a groovy API now or are you talking about using one of the existing web service APIs?
thumbnail
David H Nebinger, modified 6 Years ago. Liferay Legend Posts: 14933 Join Date: 9/2/06 Recent Posts
Groovy scripts leverage the existing Liferay APIs. It can be an easy way to access the APIs to load data w/o having to build modules to do the same.
thumbnail
Alfred Sampang, modified 6 Years ago. New Member Post: 1 Join Date: 5/21/19 Recent Posts
Like Dave has said, you have the options of Resource Importer or Site Initializer. Resource Importer still looks great, and you can just place the theme's .war file to import all you need in that LAR. I've never used Site Initializer myself.
In a recent project Resource Importer was overkill and I opted to instead use the Upgrade Process + ExportImportLocalService API. I wouldn't really recommend this way (dependencies can break this left and right) but it never hurts to have more options.
thumbnail
William Gosse, modified 6 Years ago. Liferay Master Posts: 533 Join Date: 7/4/10 Recent Posts
Is the resource importer your thinking of? https://web.liferay.com/marketplace/-/mp/application/15502239
​​​​​​​It says its for 6.2+ but I'm wondering if it would actually work for 7.0.
thumbnail
David H Nebinger, modified 6 Years ago. Liferay Legend Posts: 14933 Join Date: 9/2/06 Recent Posts
Resource importer is integrated into Liferay, there's no marketplace version for 7.x.
thumbnail
William Gosse, modified 6 Years ago. Liferay Master Posts: 533 Join Date: 7/4/10 Recent Posts
I s this new for 7.x, specifically 7.0 which we're using, and is it documented somewhere?
thumbnail
David H Nebinger, modified 6 Years ago. Liferay Legend Posts: 14933 Join Date: 9/2/06 Recent Posts
what "this" are you referring to?
thumbnail
William Gosse, modified 6 Years ago. Liferay Master Posts: 533 Join Date: 7/4/10 Recent Posts
Sorry,  the resource importer.
thumbnail
David H Nebinger, modified 6 Years ago. Liferay Legend Posts: 14933 Join Date: 9/2/06 Recent Posts
Resource importer has been around for a long, long time, back to 6.x days.