Find the answer to your Linux question:
Results 1 to 6 of 6
How can i restore from a Code: backup.tgz file created from another red hat linux server on my own server. I tried the command the following command: Code: tar xvpfz ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2014
    Posts
    3

    How to restore from backup.tgz file in linux


    How can i restore from a
    Code:
    backup.tgz
    file created from another red hat linux server on my own server. I tried the command the following command:

    Code:
    tar xvpfz backup.tgz -C /
    The above command worked, but it replaced the existing system files which made my linux server not to work properly. please how can i restore so that services and installed files on the other server will be available on my server. i use redhat5.

  2. #2
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,387
    Hi and welcome

    how was that tarball created, what exactly is in there?

    Are the two machines identical in terms of hardware, mountpoints, operating system, OS version, patch level and -where possible- in daemon config?
    You must always face the curtain with a bow.

  3. #3
    Just Joined!
    Join Date
    Jun 2014
    Posts
    3
    Quote Originally Posted by Irithori View Post
    Hi and welcome

    how was that tarball created, what exactly is in there?

    Are the two machines identical in terms of hardware, mountpoints, operating system, OS version, patch level and -where possible- in daemon config?
    here is the command i used to backup

    Code:
    tar cvpjf backup.tar.bz2 --exclude=/backup.tar.bz2 --exclude=/lost+found --exclude=/media /

  4. #4
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,387
    That is a possible, but imho a crude backup solution.
    - It depends on the hardware being more or less the same,
    - It depends on the partition layout being the same
    - It is almost guaranteed to break the network config, as the mac addresses of the nics will be wrong.
    - As you experienced, it overwrites existing files and doesnt touch files that are not within the tar

    To be honest, I would drop the current approach of copying the whole directory tree and instead introduce a proper backup policy:
    ie: only copy datafiles and db dumps, repository dumps, etc
    Config files should be in a git repository and in the best case be deployed via an automation tool like puppet.
    You must always face the curtain with a bow.

  5. #5
    Just Joined!
    Join Date
    Jun 2014
    Posts
    3
    Quote Originally Posted by Irithori View Post
    That is a possible, but imho a crude backup solution.
    - It depends on the hardware being more or less the same,
    - It depends on the partition layout being the same
    - It is almost guaranteed to break the network config, as the mac addresses of the nics will be wrong.
    - As you experienced, it overwrites existing files and doesnt touch files that are not within the tar

    To be honest, I would drop the current approach of copying the whole directory tree and instead introduce a proper backup policy:
    ie: only copy datafiles and db dumps, repository dumps, etc
    Config files should be in a git repository and in the best case be deployed via an automation tool like puppet.
    ok. How do i proceed with this?

  6. #6
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,387
    That can be a quite big topic with various projects.

    First of all: Are we talking about
    a) a one time effort to migrate services and data from one machine to another
    or
    b) building and maintaining multiple machines (ie: a datacenter)?

    For the one time effort a)
    - install the new machine with an recent operating system, preferably the same distribution, version and architecture as the old one
    - have a git repository and populate it with the config files of the old machine
    - configure the necessary daemons on the new machine with the config files from the git repo
    - dump databases, repos etc on the old machine
    - rsync the static data files to the new machine
    - test
    You must always face the curtain with a bow.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •