Foren

Restoring Liferay custom pages and accounts

Barbara Regan, geändert vor 14 Jahren.

Restoring Liferay custom pages and accounts

New Member Beiträge: 9 Beitrittsdatum: 11.11.09 Neueste Beiträge
Several months ago I installed Liferay portal version 5.2.2 (bundled with Tomcat 5.5) on a virtual server that is accessible over the Internet. I removed the out-of-the-box user accounts and created my own. I modified the default pages and created a number of pages of my own. I also uploaded and installed some custom portlets that I had developed.

This morning when I went to the top-level URL of the portal all the custom pages and user accounts that I created were gone. The configuration had been set back to the out-of-the-box user accounts and sample pages.

At first I thought that someone (I am not the admin of the virtual server) might have reinstalled Liferay. But I looked at the timestamps on the files and directories and they all match the time of the original installation. I can see the folders under webapps that were created for my custom portlets. I believe that all of the data is there but I am not familiar enough with Liferay to know why it is displaying the out-of-the-box pages and accounts, instead of the ones that I created. I tried stopping and restarting Tomcat, but it made no difference.

Can someone help me figure out how to restore the Liferay site pages and accounts that I had?

Thank you,
Barbara
thumbnail
Lisa Simpson, geändert vor 14 Jahren.

RE: Restoring Liferay custom pages and accounts

Liferay Legend Beiträge: 2034 Beitrittsdatum: 05.03.09 Neueste Beiträge
*grimace* I hope that you ahve backups of your server. You're probably going to need to restore you database and your data directory.
Barbara Regan, geändert vor 14 Jahren.

RE: Restoring Liferay custom pages and accounts

New Member Beiträge: 9 Beitrittsdatum: 11.11.09 Neueste Beiträge
I am contacting the server admin team to find out how much of the data on the server is being backed up. There should be backups taking place for the server, but the team would not know how to back up the Liferay portal (which I don't know how to do, either).

Can you tell me how the data directory is related to the database contents? I did some poking around in the data directory. It looked to me like many of the files had recent timestamps, at least more recent than when I did the installation. There is a large text file in the data/hsql directory called lportal.script. I did some searching in that file and was able to find strings from user accounts and pages that I had created.

Thanks,
Barbara
thumbnail
Olaf Kock, geändert vor 14 Jahren.

RE: Restoring Liferay custom pages and accounts

Liferay Legend Beiträge: 6403 Beitrittsdatum: 23.09.08 Neueste Beiträge
the hsql directory contains the database in the default install - a database that you should not use in production. The reason is, that what you see there is the extremely convenient but completely unperformant datastore for all the data you store there. You can see all the INSERTs and UPDATEs to your database until the script is "compressed" - might be that you're able to restore your database by removing the re-population of the database from the end of the script. If you don't know what's in there, get help from someone who knows SQL.

In your next installation, remove the sevencogs directories from tomcat's webapps directory: The sevencogs-hook is responsible for repopulating the database on startup, if it doesn't find bruno in the users list. Also, you might want to consider using a real database.
Barbara Regan, geändert vor 14 Jahren.

RE: Restoring Liferay custom pages and accounts

New Member Beiträge: 9 Beitrittsdatum: 11.11.09 Neueste Beiträge
I think you have explained a lot of what is going on here, although questions still remain for me.

If I understand what you are saying, the consequences of removing the user account for "bruno" are that whenever the database (server?) is restarted the sevencogs-hook (whatever that is) will repopulate the database with the default data. That would make sense because our servers were restarted by the admin team last week and I'm fairly sure that at some point before that I deleted the account for bruno because I had created another account for the person who would have the roles of bruno.

I reexamined the lportal.script file and was mistaken in thinking that there were text strings in there that came from the pages and accounts I had created. I don't think there is anything in there except the original default data. I do understand SQL; I knew that I was seeing INSERT and UPDATE SQL statements. I just don't understand what Liferay is doing with the lportal.script and other files to create this default database. The installation was mostly a "show-and-tell" to convince my management that Liferay was a cool product. That's one reason I haven't yet gone to the trouble of figuring out how to replace the default database with a real database. Management right now does not seem to be very interested in standing up a portal.

If it turns out that the server team has been backing up all the directories on the server, will it be possible to restore the database that I had created by simply copying in my version of the lportal.script file? Or is there more that has to be done to restore the database?

Thanks for the help,

Barbara
thumbnail
Lisa Simpson, geändert vor 14 Jahren.

RE: Restoring Liferay custom pages and accounts

Liferay Legend Beiträge: 2034 Beitrittsdatum: 05.03.09 Neueste Beiträge
Restore the data like you would with any database. The data directory is inside the Liferay directory. Restore that. Add in the Bruno account but leave it inactive. Restart and you should be golden.
thumbnail
Olaf Kock, geändert vor 14 Jahren.

RE: Restoring Liferay custom pages and accounts

Liferay Legend Beiträge: 6403 Beitrittsdatum: 23.09.08 Neueste Beiträge
The file lportal.script is the database. Therefor liferay does either nothing with it or set it up - depending on your point of view. Liferay interfaces with it through JDBC, it just happens that this database (hsql) is set up to use this overly simple backend datastore.

Most likely you're able to use it directly by placing it where it belongs and restart liferay. Most likely this is all you need to restore. I can't remember if the default setting for image gallery and document library was to store in database or in files. You might need to regenerate some search indizes.

Regarding your "a hook - whatever that is": It's a plugin, providing ways to add code to liferay that's run on specific events, e.g. on startup. The sevencogs plugin happens to check if bruno is around and, if not, makes him be around and feel at home by re-initializing the database to contain the demo stuff you saw. Hooks live in tomcat's webapps folder and you can just delete them there. Otherwise your just-restored database would be initialized again.
thumbnail
Lisa Simpson, geändert vor 14 Jahren.

RE: Restoring Liferay custom pages and accounts

Liferay Legend Beiträge: 2034 Beitrittsdatum: 05.03.09 Neueste Beiträge
Actually, my experience has been that if the default omniadmin account isn't there, even with the hook removed, the scripts will recreate the empty database on restart. Since avoiding having your database recreated each time you restart, you need to make sure that there is something like this *as the first row* of your User_ table

10115 10112 8/3/2009 16:56 8/3/2009 16:56 1 10116 password 0 0 \N 0 10115 default@liferay.com 0 en_US America/Chicago Welcome! 8/3/2009 16:56 \N \N 0 0 \N 1 0

You can keep it deactivated, but without it the database will recreate. With the 7cogs stuff in place, that's the bruno account.
thumbnail
Olaf Kock, geändert vor 14 Jahren.

RE: Restoring Liferay custom pages and accounts

Liferay Legend Beiträge: 6403 Beitrittsdatum: 23.09.08 Neueste Beiträge
Thanks - this way it seems I've been lucky. I'll immediately try to reproduce, as I've never seen this.

Phew...
Barbara Regan, geändert vor 14 Jahren.

RE: Restoring Liferay custom pages and accounts

New Member Beiträge: 9 Beitrittsdatum: 11.11.09 Neueste Beiträge
I finally heard back from the server admin team and the bad news is that they have no backups of the server. I decided that I would take the time to recreate the pages and accounts that I had. Now I find that, even though the default data was restored and the initial page has the links for logging in as the 7-cogs users, the system does not recognize the passwords of the 7-cogs users. It doesn't recognize the users that I had created earlier, either.

In other words, I don't see any way that I can log in. Can you help?

Thanks,
Barbara
Barbara Regan, geändert vor 14 Jahren.

RE: Restoring Liferay custom pages and accounts

New Member Beiträge: 9 Beitrittsdatum: 11.11.09 Neueste Beiträge
By following the steps posted here

http://www.liferay.com/web/guest/community/wiki/-/wiki/Main/7Cogs%20sample%20data#_36_message_3408251


I was able to get to a state where the sevencogs data is removed and I can now log in as test@liferay.com and begin to recreate the user accounts and pages that I had. Bruno is gone but I think I understand that as long as the sevencogs data and the 2 sevencogs folders in webapps are gone that I will not have the problem again where a server restart overwrites the database.

Hope this experience helps someone else.

Barbara