[MGNLBACKUP-40] Provide ServletContextListener to allow restore from within server env Created: 19/Jul/11  Updated: 29/Mar/22  Resolved: 22/Dec/11

Status: Closed
Project: Backup
Component/s: None
Affects Version/s: 1.1.3
Fix Version/s: 1.1.4

Type: Improvement Priority: Neutral
Reporter: Jan Haderka Assignee: Zdenek Skodik
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File RestoreServletContextListener.java.patch    
Issue Links:
causality
is causing DOCU-172 Document new restore possibility in B... Closed
dependency
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Date of First Response:
Team: Nucleus

 Description   

It is possibly to use server provided resources with Magnolia such as connections over JNDI. Since the resource is managed by server it is necessary to run from within server environment during restore in order to be able to make use of such resources.



 Comments   
Comment by Jan Haderka [ 19/Jul/11 ]

Usage:

  1. Shutdown tomcat
  2. Edit web.xml:
    1. comment out filter, filter-mapping, and listener elements
    2. add the listener for RestoreServletContextListener:
      web.xml
      <listener>
          <listener-class>info.magnolia.module.backup.servlet.RestoreServletContextListener</listener-class>
      </listener>
      
  3. Edit magnolia.properties
    1. add a new property magnolia.backup.dir:
      magnolia.properties
      # The directory in which backup files are searched when performing a restore
      magnolia.backup.dir=${magnolia.app.rootdir}/WEB-INF/backup/latest
      
  4. Copy the contents of the latest backup to the location specified by magnolia.backup.dir
  5. Startup tomcat, the restore should execute.
  6. Once the restore is finished:
    1. Shutdown tomcat
    2. Remove the listener for RestoreServletContextListener, uncomment filter, filter-mapping, and listener elements
    3. Remove the contents of magnolia.backup.dir
    4. Optionally you might still need to remove indexes to force reindexing
Comment by Matt Dertinger [ 03/Aug/11 ]

Hi Jan,

It seems that the RestoreConfig object doesn't have visibility to the propertiesFilesProperty. However, it does have a set method (setPropertiesFilesProperty), so I decided to try that and it works. There may be a cleaner way, but I'm attaching a patch for RestoreServletContextListener implementing this approach. Let me know if you have any questions.

Cheers,
Matt

Comment by Matt Dertinger [ 03/Aug/11 ]

See above comment along with the attached patch.

Thanks,
Matt

Generated at Sun Feb 11 23:25:00 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.