RE: Can´t login after DB migration

Iñigo Boyano, modified 6 Years ago. Junior Member Posts: 96 Join Date: 2/4/14 Recent Posts
Hi, 

I did a database migration from a development environment to my local environment in order to have the same portal to develop in local.
The migration was correctly but when i try to login in the local portal, i give the follwing errors:

"Your request could not be made correctly."

"Authentication has failed. Please try again"

The user with i'm trying to access is the liferay default user and i can't see any trace in the local log.
test@liferay.com // test.

Is there any way to access as administration in this case? Something i can modify in DDBB to allow me to log?
thumbnail
Alberto Chaparro, modified 6 Years ago. Liferay Master Posts: 560 Join Date: 4/25/11 Recent Posts
Hi Iñigo,

If you came from 6.1 please take into account that the password encryption algorithm has changed:
https://dev.liferay.com/en/discover/deployment/-/knowledge_base/6-2/upgrading-liferay#review-the-liferay-6-2-properties-defaults

Even if you came from 6.2 or 7.0 please, verify if you have any property related to the password encryption algorithm in your portal-ext.properties.

​​​​​​​I hope it helps.
thumbnail
Eddie Chow, modified 6 Years ago. Junior Member Posts: 53 Join Date: 8/28/13 Recent Posts
What I've done is set the setup.wizard.enabled=true and restart liferay and then create a new admin user when I hit the basic configuration screen. Make sure that the database connection is the same.
thumbnail
Olaf Kock, modified 6 Years ago. Liferay Legend Posts: 6441 Join Date: 9/23/08 Recent Posts
Iñigo Boyano

I did a database migration from a development environment to my local environment in order to have the same portal to develop in local.
The migration was correctly but when i try to login in the local portal, i give the follwing errors:
I doubt that the migration was done correctly.

Note that there's more than the database that you'll need to bring over into your other environment - notably the Document Library and potentially the search index (which can be regenerated).
My advice is: Don't use the database migration, instead just restore your backup. This way you gain the privilege of actually being allowed to call it a backup:
My standard is that you're only allowed to call a collection of data a backup if you have recently demonstrated that you're able to use it to restore to a completely separate environment. Use this to your advantage.
Iñigo Boyano, modified 6 Years ago. Junior Member Posts: 96 Join Date: 2/4/14 Recent Posts
Hi Olaf, 

I've tried to create a *.lar from development to import in my local environment but both environments have diferent version and the lar import throws an error, so, i'va back to the import of DDBB. In this point i can't login with test@liferay.com // test because i get an authentication error. 
Is there any way for log as administration in this site?

Kidn regards, 

Iñigo
thumbnail
Olaf Kock, modified 6 Years ago. Liferay Legend Posts: 6441 Join Date: 9/23/08 Recent Posts
Iñigo Boyano
back to the import of DDBB. In this point i can't login with test@liferay.com // test because i get an authentication error. 
Is there any way for log as administration in this site?
I'd say: A proper migration is the way to go. Notice the password hashing algorithm, mentioned above by Alberto. The database might be migrated correctly, but Liferay believes that the password hashing is different from what is actually stored in the database. Make sure that you have this configured correctly.

Although I'll never be found to suggest changing Liferay's database directly, I'm guilty of once having manually changed the "password" field for a user to "someting", and the "encrypted" column to "false". Don't do that. No matter who gives you the idea. It's wrong. It doesn't fix your underlying problem and would only be bandaid that possibly gives you enough access to ignore all other problems.
Iñigo Boyano, modified 6 Years ago. Junior Member Posts: 96 Join Date: 2/4/14 Recent Posts
Ok, understood.
My question now is: ¿what is the proper way to do the migration, taking into account that to do this by *.lars is not viable because the different version between environments?

Kind regards, 
thumbnail
Olaf Kock, modified 6 Years ago. Liferay Legend Posts: 6441 Join Date: 9/23/08 Recent Posts
Iñigo Boyano
My question now is: ¿what is the proper way to do the migration, taking into account that to do this by *.lars is not viable because the different version between environments?
The proper way: Upgrade the database. If you need LAR files, generate new LAR files after migration. The only upgrade routines that exist are for the database, not for LAR archives.
So, according to what I read above, you were trying the right things. Odds are that you literally just missed the "legacy properties", e.g. containing the password hashing algorithms. They're clearly documented in the upgrade instructions - do you remember you used the legacy properties?
Did you get into your system by now?