Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am in the situation where i have had to make several upgrades or try out different distributions. This has meant that whenever i have to re-install the OS i have to re-install everything and recopy all my files after each linux installation.
What i would like to do is build a system in such a way that when i replace the linux operating system either via an upgrade, a clean install or a distribution change i would like not to have to make changes to any of my existing programs and files or if i have to, the changes should be minimal.
The kind of files i am talking about are a website running on Apache and Tomcat, a mysql database and some applications. Is this possible?
I know in Apache, it is possible to change the root directory of DOCROOT. I am not sure if the path to the database files for mysql can be redirected from the default location.
With Tomcat, i know that it can be reconfigured so that its AppBase is somewhere else.
Has anyone done something like this before? Presumabely it can be done by having a partition that will include everything which i need to be permanent.
I am not really sure if this will work so i would like to know if it is possible and if you've done it before and how? And what should i watch out for.
A lot of people mount their /home directory from a second partition, for this very reason, and if you use logical volume management, you can make it even more finegrained.
It is a bit harder where you have configured settings in /etc, but you have a few options. You can make use of user override settings wherever possible, so that you can keep the setting variations in the /home area (though not all applications make this easy). Or you could symbolically link relevant config files in /etc through to the second partition, so that after a new install you only had set up the links again.
Preserving applications, especially complex ones like apache and so on can be harder, because different distros have various conventions on where the components are stored (libraries, configurations, etc), so it is often easier just to reinstall. And worse, the dependencies will be different in different distros - different versions of the application, different library dependencies and different kernel versions. So you should be aiming at preserving settings and data, not the application itself.
If you can stick to a single distro, upgrades are not such an issue; admittedly configuration files are sometimes overwritten because there has been a significant change to the options. But this can be handled by keeping a backup of the /etc directory so that the settings can be reinstated on the upgrade.
A lot of people mount their /home directory from a second partition, for this very reason, and if you use logical volume management, you can make it even more finegrained.
It is a bit harder where you have configured settings in /etc, but you have a few options. You can make use of user override settings wherever possible, so that you can keep the setting variations in the /home area (though not all applications make this easy). Or you could symbolically link relevant config files in /etc through to the second partition, so that after a new install you only had set up the links again.
Preserving applications, especially complex ones like apache and so on can be harder, because different distros have various conventions on where the components are stored (libraries, configurations, etc), so it is often easier just to reinstall. And worse, the dependencies will be different in different distros - different versions of the application, different library dependencies and different kernel versions. So you should be aiming at preserving settings and data, not the application itself.
If you can stick to a single distro, upgrades are not such an issue; admittedly configuration files are sometimes overwritten because there has been a significant change to the options. But this can be handled by keeping a backup of the /etc directory so that the settings can be reinstated on the upgrade.
Ok i guess its not as simple as i thought it would be. At the moment i am using Debian and dont have any plans to change to another distribution. I thik for now i will try and stick with the simple things first and build in that.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.