[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: how to backup and restore /var partition.



H. S. wrote:
> I want to reinstall Debian on a machine which is also running my local  
> web server. I am planning on backing up /home, /var and /etc.

Backups are good.  But...

Re-install?  Why?  Is the machine running now?  If so then why not
simply upgrade it?  Please tell us more!  Sometimes people come to
Debian from other distros where upgrades do not work and so they think
that they need to install from scratch to move forward.  But in Debian
upgrades do work and have for almost forever.  Really!

> When I want to restore these on the newly installed system, how exactly  
> do I do the restore with /var? Do I just copy the earlier /var to the  
> new one? During and right after installation, I am sure /var/log/syslog  
> is being build up. What is the recommended way to restore /var in this  
> situation?

Overwriting /var with an old copy will cause trouble.  I am sure that
you have some need in mind.  Why do you want to do this?  What is
there that you want to restore?  If something like /var/www then you
can safely restore just /var/www okay.  But otherwise just overwriting
/var from a different and older system will definitely break a lot of
system functionality.  For example dpkg keeps its brain there.

You will probably have some trouble with /etc too.  Because the new
system will have newer syntax in various files the /etc and again,
overwriting those with the older systems versions will cause trouble.
You could go through your systems one by one and use the old files as
a template and re-edit the new files into shape using the old ones as
reference.  That is about the best way to do it if you really want to
move the functionality onto the new system from an older one.

But again, if you are wanting to preserve so much of the old system
and the old system sounds like it is running okay, then I think you
really should be thinking of simply upgrading it.  Then during the
upgrade the packages will handle any migrations from old formats to
new format in the various places.

> Regarding apache, I suppose I just copy the /var/log/apache to the new  
> system before starting apache?

System logs would be okay to move forward.  But note that you would
lose the information that happened during the installation if you move
/var/log/dpkg.log forward.  But logs are informational only so nothing
will break if those are lost.

> Any further tips are much appreciated.

Upgrade.  Don't re-install.  :-)

Bob

Attachment: signature.asc
Description: Digital signature


Reply to: