Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've got a VPS. I wish to downgrade its plan. But, according to the provider, I'll have to set it up again, which, I think, would be time consuming.

Is there anything I could do to backup my current setup, download it on my drive, downgrade, upload the backup on new system and restore it?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

According to FHS, all global settings are stored in /etc and /usr/local/etc/.

User data and settings are stored in /home/user_name for regular users and /root for root.

Service data, like web pages, may be stored in /var or somewhere else, you better know your environment.

You have to backup up it all. Also you need to save list of software repositories and list of installed packages(this is things are specific for each linux distrib).

Install clear system. Restore repositories settings. Update avaliable package index. Install all packages from saved list. Restore settings and service data. You have completely the same system.

For example, in Debian/Ubuntu:

Save /etc/apt/sources.list and /etc/apt/sources.list.d/* for repositories.

Save dpkg --get-selections > packages_list for packages list.

Install new system. Restore repositories settings.

apt-get update
apt-get dist-upgrade
dpkg --set-selections < packages_list
apt-get dselect-upgrade

Now you may restore settings and data.

share|improve this answer
    
Sorry, I forgot to mention that I'm on CentOS. @Selivanov –  kapeels Sep 26 '11 at 16:44
    
For CentOS you have repositories settings in/etc/yum instead of /etc/apt. Saving list of installed packages and restoring them is described here. All other steps are the same. –  Selivanov Pavel Sep 26 '11 at 18:59

If you are able to boot from some Linux LiveCD on VPS, you may just backup your whole installation with tar:

tar -cvpfz /backup/fullbackup.tar.gz --directory=/ --exclude=proc \
--exclude=sys --exclude=dev --exclude=backup .

Then copy it over ssh or ftp to your machine. Downgrade VPS, boot from LiveCD again, create new partitions with the same arrangement, mount your new root partition to /mnt/root, mount all other partitions to corresponding subdirectories in root partition: new /var partition to /mnt/root/var and so on. Upload your backup to VPS and restore it:

tar -xvpfz /mnt/root/backup/fullbackup.tar.gz --directory /mnt/root

Fix /mnt/root/fstab. Restore the boot loader. Reboot and check if everything is OK.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.