Foren

Importing LAR files

thumbnail
Jan Beran, geändert vor 8 Jahren.

Importing LAR files

Junior Member Beiträge: 44 Beitrittsdatum: 30.06.15 Neueste Beiträge
Hi everybody

I will need to upgrade my Liferay portal in the near future. I can't just upgrade the portal and need to do a clean install (don't ask why, that's just how things are for me). Since I wanted to preserve all the data, I came with an idea of importing them to a clean localhost, upgrade that and than export those to the clean installation of the higher version of portal. So I exported the JAR file with data from the portal (6.2 GA3), but when I tried to import it to the localhost, I ran into several problems.

1) Web content is imported successfully.
2) Importing the DDLs gives he error: Unable to execute background task com.liferay.portal.kernel.lar.PortletDataException: com.liferay.portlet.dynamicdatalists.RecordSetNameException
3) Importing the Knowledge base portlet gives the erorr: Unable to execute background task com.liferay.portal.kernel.lar.PortletDataException: java.util.UnknownFormatConversionException: Conversion = '%'

What are these errors? How can I prevent them? Any advice is much appreciated.

Thanks
thumbnail
David H Nebinger, geändert vor 8 Jahren.

RE: Importing LAR files

Liferay Legend Beiträge: 14915 Beitrittsdatum: 02.09.06 Neueste Beiträge
LAR imports are exact version dependent, but they can also be plugin dependent, environment dependent, user dependent, ...

You'd be better of cloning current environ (rather than importing) and upgrade the clone to export from, but that's not guaranteed to work on the clean environment if it is missing some of the necessary data (i.e. if you tried to import into an environ with no KB plugin, that will just fail since the dependencies will not be there for the import to work).

LARs are not the nice and easy migration mechanism everyone wants them to be...
thumbnail
Jan Beran, geändert vor 8 Jahren.

RE: Importing LAR files

Junior Member Beiträge: 44 Beitrittsdatum: 30.06.15 Neueste Beiträge
I see. In that case, lets consider a scenarion, where I have two very similar portal deployments (portal version, plugins installed, etc.) What is the preferable method for migration of data from one portal to other other in such case?
thumbnail
David H Nebinger, geändert vor 8 Jahren.

RE: Importing LAR files

Liferay Legend Beiträge: 14915 Beitrittsdatum: 02.09.06 Neueste Beiträge
There's no guaranteed way to move between "similar" deployments.

You shouldn't have any problem moving between "exactly the same" deployments with LARs.

But for "similar" environments you can try LARs and, depending upon what you include in the LAR file, it may work or it may not.

It really depends upon what dependencies the LAR file has. For example, if the LAR has a dependency on a structure but the structure is neither included in the LAR and it does not exist in the target environ, the LAR file will fail. Has nothing to do with version or plugins, it's an unsatisfied dependency in the LAR.

This becomes the point where your plan begins to break down. The more you include in the LAR to remove external dependencies, the more cruft you're going to end up moving from the old environment to the new one.

I believe your better plan would be to clone your current environment and clean it up. Remove the cruft that you don't want going forward. Then let Liferay upgrade that environment and use it in production.
thumbnail
Jan Beran, geändert vor 8 Jahren.

RE: Importing LAR files

Junior Member Beiträge: 44 Beitrittsdatum: 30.06.15 Neueste Beiträge
Thanks for the reply David.

I now understand that the less I ex/import with the LAR file the better. So, I tried this approach with a DDL LAR file. The DDLs in the "old" portal only included 1 data definition with 3 display templates and about 20 record sets, that do not contain any data.

When I import the LAR file to the "new" portal, I get the above mentioned RecordSetNameException. After digging in the portal code for a while, I found the offending line:

protected void validateName

if (Validator.isNull(name))
{
    throw new RecordSetNameException();
}


But that does not make sense. All the record sets have names. Is the record set name sensitive to whitespaces maybe? Or are there some leftover sets in the database (cruft you call it?), that were previously deleted and are now invisible in the GUI? Is it possible to find and remove such artifacts?

I also read somewhere, that it could be a good idea to first import the structures, and then data. When I tried this, the data definition and templates were imported OK, but the following import of data sets only got to 7% and then froze, with no exception thrown.

Thanks in advance.
thumbnail
Bhaskar Kumar, geändert vor 8 Jahren.

RE: Importing LAR files

Junior Member Beiträge: 38 Beitrittsdatum: 22.05.13 Neueste Beiträge
Hi Jan,
Did you Problem solved?

Thanks..
Bhaskar
thumbnail
Jan Beran, geändert vor 8 Jahren.

RE: Importing LAR files

Junior Member Beiträge: 44 Beitrittsdatum: 30.06.15 Neueste Beiträge
Hi Bhaskar

No, unfortunately I was not able to solve this.
thumbnail
Jorge Díaz, geändert vor 8 Jahren.

RE: Importing LAR files

Liferay Master Beiträge: 753 Beitrittsdatum: 09.01.14 Neueste Beiträge
Hi all

Those problems during LAR import sometimes are produced by inconsistent data at exported site or a different configuration between source and destination.

Check site and portal configured languages both sides must have configured same available and default languages to avoid issues.

Also check stored data and verify that problematic records have assigned a valid translation at default languages, as it is verified during import.