Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


restoring backup /etc
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

restoring backup /etc

Before I wiped my VPS Debian 6, I have backed up /etc folder. Then I have installed Debian 8 and tried to overwrite /etc with my older one /etc folder, but something broke down.
If I first Install Debian 6 than overwrite /etc and only after that update to Debian 8, will it work than?

Comments

  • should. keep in mind network config is in etc.

  • And every other config file

  • singsingsingsing Member
    edited October 2015

    cikatomo said: If I first Install Debian 6 than overwrite /etc and only after that update to Debian 8, will it work than?

    Unadvisable unless you also install all of the packages you previously had installed (at the time /etc was backed up) before overwriting /etc.

    Nobody maintains systems by editing files in /etc by hand anymore. At minimum, you should have a script under version control that selects packages and updates configurations in /etc.

    Then you can just run the script on a fresh install.

  • simonindia said: And every other config file

    Yes, but on a VPS the network config is the most likely to break it - SSHD default config from 6 should work fine.

  • @cikatomo said:
    If I first Install Debian 6 than overwrite /etc and only after that update to Debian 8, will it work than?

    It has a much better chance of working, but it is still not guaranteed unless you know that you have exactly the same packages installed and you are installing on the same VPS (so no network settings need to be different). Even if you install nothing else other than the packages from the default install options, a fresh install of Debian 6 may have different packages to one that started out as Debian 5 and was upgraded.

    I would recommend running a "diif" between the fresh /etc and the copy of the old one and copying over the differences that you know to be both significant & required and reading around the ones you are not sure about. Some of the differences will highlight package differences if there are any as well as differences between the old and the new settings for those that are otherwise in the same state.

  • @William said:
    Yes, but on a VPS the network config is the most likely to break it - SSHD default config from 6 should work fine.

    I know that man that why added my comment with yours

  • @singsing said:
    Then you can just run the script on a fresh install.
    @singsing said:
    Then you can just run the script on a fresh install.

    I didn't know that. Where can I learn more about those scripts?

  • singsingsingsing Member
    edited October 2015

    cikatomo said: I didn't know that. Where can I learn more about those scripts?

    http://www.tldp.org/LDP/abs/html/

    If you want something more automatic, try searching for "puppet" or "chef" -- never used these myself but might have more diagrams & howtos than rolling your own bash scripts.

    Thanked by 1cikatomo
  • @cikatomo said:
    Before I wiped my VPS Debian 6, I have backed up /etc folder. Then I have installed Debian 8 and tried to overwrite /etc with my older one /etc folder, but something broke down.
    If I first Install Debian 6 than overwrite /etc and only after that update to Debian 8, will it work than?

    Um, This is not how you backup a linux machine.

  • @vinny said:
    Um, This is not how you backup a linux machine.

    I have googled and everywhere said I should backup that folder with few others. How do you backup?

  • cikatomo said: I have googled and everywhere said I should backup that folder with few others. How do you backup?

    Depends on what you ran on your VPS. :) You really just need config files and data folders of applications you use..

  • @cikatomo said:
    I have googled and everywhere said I should backup that folder with few others. How do you backup?

    You can back it up.. and use it as a reference.. example. httpd configs, network config, etc... but as far as just overwriting a new install with old etc files... not a good idea..

    You'll run into problems with changes in syntax of config files, just the differences in how etc files are arranged between debian 6 & 8, init/rc startup scripts will certainly be messed up.

    I backup with various methods, snapshots, offsite storage, rsync, configuration management (chef, etc), google drive, dropbox, list goes on and on.

  • if you're just compressing files/database and restoring over the other end these commands can be used

    Backup
    mysqldump -h localhost -u YOUR_MYSQL_USER -p YOUR_DATABASE_NAME -r backup.sql
    zip -r backup.zip /home/username/*
    
    Restore
    mysql -u YOUR_NEW_MYSQL_USER -p YOUR_NEW_DATABASE_NAME < backup.sql
    unzip backup.zip
    

    but you will of course need to setup all pre-requisites in your new server

  • @century1stop

    Did you even read his post? He said nothing about a database, nor home directory. He's talking about backing up his configuration in /etc/ (retardedly, but that's what he's talking about)

  • erm I glanced the h1 tag, does that count? ;:O

  • @century1stop I wouldn't use zip for backup. It drops way more l33t Linux metadata than, tar, the tool that you're supposed to use for that.

    Thanked by 1century1stop
Sign In or Register to comment.