Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Marc Heimann
Restore Liferay without restart
May 14, 2013 3:33 AM
Answer

Marc Heimann

Rank: New Member

Posts: 21

Join Date: February 19, 2013

Recent Posts

Hello,

My situation in short: My job is to write portlets and from July on also maintain Liferay all by myself because my colleague will be leaving the company then. The plan is to go live in September. I am taking over a project (mainly hooks, some portlets and ext) from an external company. Right at the moment, I'm troubled by a horde of bugs which make Liferay useage hard or even impossible (e.g. can't login). We'll be having a meeting this week to actually sort our buglist according to origin i.e. from Liferay or the external company. With my 3 months of experience, I feel a bit overwhelmed.

My first idea was to write a script to do a new Liferay installation. Then I would try to import content from a source that is kept away from Liferay to make sure bugs won't get carried along. However, this method was turned down because we don't want to be restarting the production server all the time. So I asked myself, if it is possible to do something like a restore while the server keeps running.

I have already had a look at Portal backup and restore. Mika Koivisto wrote about consistency here which is I think very important in my case. I also read an article about caching from Jorge Ferrer here. I'm not sure how to handle the cache at all. Should I clear/flush it before doing a backup or after a restore, what does hibernate do when the database is locked?

I'd really be grateful for any hint.
Oliver Bayer
RE: Restore Liferay without restart
May 15, 2013 1:59 AM
Answer

Oliver Bayer

Rank: Liferay Master

Posts: 883

Join Date: February 18, 2009

Recent Posts

Hi Marc,

what do you mean by "all the time"? Normally you only have to stop the server once to create a backup. Or do you need daily backups? If you only need it for testing purpose you can try to back it up while the server is running - even if it's not a clean/ preferred solution.

Create a backup of your database, copy the "data \ document_library" directory to your test server and change the database settings in portal-ext.properties to point to the backup database. Now you can start your test server. If you want to test e.g. the search capabilities you should first go to the control panel and start the re-indexing.

HTH Oli
Ahmed Hasan
RE: Restore Liferay without restart
May 15, 2013 2:02 AM
Answer

Ahmed Hasan

Rank: Expert

Posts: 306

Join Date: April 13, 2007

Recent Posts

Hi Marc,

If you can give your exact requirements, then i can be of some help in implementing a holistic solution.

Not very clear from what you've written in the forum post.
Marc Heimann
RE: Restore Liferay without restart
May 15, 2013 3:36 AM
Answer

Marc Heimann

Rank: New Member

Posts: 21

Join Date: February 19, 2013

Recent Posts

Hi Oliver,

our buglist contains 10+ minor bugs. Last week the whole login disappeared on our test server and on our live server the navigation portlet won't show child pages when clicking on one of the pages. I'm not sure at what rate bugs will keep coming. The "restoring solution" would require to restart the server every time (="all the time") some bug occurs. I would be glad if everything could be done on the test server for testing purposes. I already said that the plan is to go live in september, so I'm preparing for the worst case: new severe bugs.

The solution I have in mind is a bit more than restoring. Restoring would take me back to the state where the backup was created. However, I want to bring the site to the latest state by maintaining all necessary data outside of liferay e.g. by exporting all web content into html files. When a bug pops up, i would clone the site to be able to investigate it later, do a restore from a working backup, deploy patches and plugins and finally import the content. I already started writing a script to automatically do a liferay installation into some specified directory. But I did't continue because a new install would definetely require a restart.

So my question remains unanswered, but thanks for taking time.

@Ahmed Hasan
Thanks for your offer. I must say that I'm in no position to be hiring people. All my work is supposed to be kept within the company.
Oliver Bayer
RE: Restore Liferay without restart
May 15, 2013 5:54 AM
Answer

Oliver Bayer

Rank: Liferay Master

Posts: 883

Join Date: February 18, 2009

Recent Posts

Hi Marc,

you seem to be facing some strange bugs emoticon. What Liferay version are you using?

I don't think it's possible to create "snapshots" without restarting. Because there are two parts you have to backup. The data \ document_library directory and a dump of the current database. As long as you're tomcat is running you can't gurantee that the data is consistent - mainly because of the caches. The easiest approach would be if you've run them virtualized you can create snapshots.

But I don't think you have to create snapshots only to find the bugs. It should be possible to locate them in the running system. If you can give more details of your system and your modifications I can maybe give you some hints where to look at.

Greets Oli
Marc Heimann
RE: Restore Liferay without restart
May 15, 2013 6:52 AM
Answer

Marc Heimann

Rank: New Member

Posts: 21

Join Date: February 19, 2013

Recent Posts

Hi Oliver,

I'm using version 6.1.10. On creating snapshots: As I pointed out before, Mika seemed to have the right solution here. However, I'd really like to know more about the cache first. It would help a lot if I knew how to flush it i.e. force it to complete all CRUD operations. Then I would idle the server, hopefully short enough not to be noticed by online users, during snapshot creation or restoring. I could check for an idle flag in my own portlets before calling some *Util() method from service builder. But again, I don't know how to idle the cache. What do you mean by "run them virtualized". The live and test server both run on a virtal server with vmware. As I described above, I don't want to go back to an older state but have the latest content. Ideally, a normal user won't even notice the slightest change.

Thanks for offering me help on my login bug. I already created a new ticket and got in contact with a liferay staff.
Oliver Bayer
RE: Restore Liferay without restart
May 15, 2013 7:33 AM
Answer

Oliver Bayer

Rank: Liferay Master

Posts: 883

Join Date: February 18, 2009

Recent Posts

Hi Marc,

with "virtualized" I've meant that if you use a product like e.g. vmware you can create snaphots of your complete system. You're right Mika's solution is a little bit better but to set up a backup/snapshot for your test/debug server my quick and dirty solution would work too without interrupting the live server but with the disadvantage of having maybe one or too bad db entries or files emoticon.

If you want to programmatically reset the caches take a look at the "EditServerAction" class to see how it is realized (especially the "cacheDb()" method). If you have any other question feel free to ask again.

HTH Oli