Reputation: 289
I'am just starting with magnolia and at the very beginning it surprised me that Magnolia needs to be installed after each .war deploy to tomcat. I do some changes in my project, deploy it with mvn tomcat7:deploy/redeploy
. Tomcat automatically recognise that ROOT.war
has changed so it unpack it automatically and after that when I'm entering localhost:8080
it wants me to install Magnolia modules again. Is it really necessary to install all modules again and again after every single changes in my project and deploy? Maybe the way how I'm making changes in my project and deploying it is wrong? If I'am not mistaken in that way my content changes also will be overwritten/deleted?
Upvotes: 4
Views: 1197
Reputation: 4369
Have a look at documentation on how to configure your Magnolia for details, but in essence it's enough if you open /WEB-INF/config/default/magnolia.properties
and change magnolia.home=
to point to the directory OUTSIDE of your webapp. By default it is set to be inside of the war file so you can wipe and reinstall Magnolia easily. In your case you want your data to be permanent, so you set it out. You should still read the article linked by Daniele about how to setup your devenv and you might still want to configure different database than derby for your production use, but you should keep all your data outside of the webapp too.
HTH,
Jan
Upvotes: 3
Reputation: 2987
You have to re-install Magnolia every time because I think that you delete your repository (database) every time that you deploy a new version.
Probably you are saving your data in a folder inside webapps and every time that you deploy a new .war it is deleted.
If you want to keep your website and modules between deployments, I need to change the repository location to a different folder in the file system, or set a db connection.
You can do that by modifying the repositories.xml file or adding a custom jackrabbit conf file, in this article you will find a lot of useful info, and I suggest you to have a look into the paragraph 'Custom Jackrabbit configuration file'
Upvotes: 3