Results 1 to 7 of 7
  1. #1
    Join Date
    Apr 2005
    Location
    Suomi Finland - Hollola
    Posts
    24

    Debian's Re-Install

    Hi Everybody!

    Some tutorials or something like that where I can study how I can Re-Install Debian without deleteting users and their passwords and files and mysql's users and passwords and databases. Because I maybe must Re-Install system but i willn't delete users and their stuff.

    If is possible get backups of some files what is included example mails, databases, users and their passwords.

    Some help??? If something is indistinct so ask

  2. #2
    Join Date
    Apr 2004
    Location
    SF Bay Area
    Posts
    877

    Re: Debian's Re-Install

    Originally posted by lide
    Hi Everybody!

    Some tutorials or something like that where I can study how I can Re-Install Debian without deleteting users and their passwords and files and mysql's users and passwords and databases. Because I maybe must Re-Install system but i willn't delete users and their stuff.

    If is possible get backups of some files what is included example mails, databases, users and their passwords.

    Some help??? If something is indistinct so ask
    Assuming you can still use the system, you might try, at a minimum:

    tar cvf backup.tar.gz /etc/passwd /etc/shadow /home /var/mysql/? [optional - /var/spool ]

    Though more likely you'll just want to tarball all your /etc, just to make sure you backup all existing server software configs:

    tar czf backup.tar.gz /etc /home /var/mysql/?

    Not sure where mysql DB is installed by Debian by default. find / -name mysql.frm to find out for sure then change /var/mysql to appropriate directory.

    Anyway, once tarballed up,

    scp backup.tar.gz [email protected]:.

    ... to back it up to some other host. Copy it back over once you've reinstalled Debian and untar the file:

    mkdir /restore
    tar xzf backup.tar.gz -C /restore

    You'll want to be more than a little cautious about blindly untarring everything into the root directory so put it in /restore.

    Backup the current reinstalled system for good measure first:
    tar czf /root/currentsystem.tar.gz /etc /home /var/mysql/?

    Restore some files and directories back:
    cp -a /restore/etc/passwd /etc
    cp -a /restore/etc/shadow /etc
    cp -a /restore/home /home
    cp -a /restore/var/debian? /var/debian?
    cp -a /restore/var/spool? /var/spool?

    Make sure mysql is shutdown first before copying over any previous database files.

    I could be missing a lot depending on how custom your environment is but that might at least get you started.

    If I were to script it, it might be something like this:

    #!/bin/sh
    if [ "$1" = "backup" ]
    then
    tar czf backup.tar.gz /etc /home /usr/local/mysql/var
    elif [ "$1" = "restore" ]
    then
    echo ""
    echo "Backing up current system..."
    tar czf current_system_backup.tar.gz /etc /home /usr/local/mysql/var
    echo "Restoring original backup from /restore..."
    mkdir -p /restore
    tar xzf backup.tar.gz -C /restore
    cp -a /restore/etc/passwd /etc
    cp -a /restore/etc/shadow /etc
    cp -a /restore/home /home

    else
    echo ""
    echo "Pick an option: script.sh backup or restore"
    echo ""
    fi

  3. #3
    Join Date
    Apr 2005
    Location
    Suomi Finland - Hollola
    Posts
    24
    Yeah, thanks for you. It's working

  4. #4
    Join Date
    Apr 2003
    Location
    UK
    Posts
    2,560
    worth taking a dump of currently installed packages too

    dpkg -l

  5. #5
    Join Date
    Apr 2005
    Location
    Suomi Finland - Hollola
    Posts
    24
    Okey Last time i backup only system users, but now i have the problem, now i must backup mysql's users, but i don't find users....

    I know, databases are in the /var/lib/mysql/* but where is users? Big problem

  6. #6
    Join Date
    Jun 2003
    Posts
    961
    inside the mysql db, user table, just dump and reimport the db, it will save the usernames + passwords

  7. #7
    Join Date
    Apr 2005
    Location
    Suomi Finland - Hollola
    Posts
    24
    Thank you very much It was too simple

Posting Permissions

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