hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : VPS Hosting : Best way to backup/snapshot/clone my VPS filesystem?
Reply

Forum Jump

Best way to backup/snapshot/clone my VPS filesystem?

Reply Post New Thread In VPS Hosting Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old
WHT Addict
 
Join Date: Oct 2002
Posts: 112

Best way to backup/snapshot/clone my VPS filesystem?


Hey guys,

So let's say I'm on a VPS that does weekly backups, but want more control over restoring in case of catastrophe. What is a recommended way of doing my own snapshots? I'm worried about instances where I modify a couple .conf files the wrong way, or I do an apt-get upgrade and it breaks something, and I need to jump back to a previous snapshot. On RamNode, for instance, you can do a snapshot which is great, and it drops a tarball in /panelbackup of the whole filesystem. But there's no way to just say "wipe out my entire system and replace it completely with this snapshot." At least not that I know of.

Any info would be appreciated!

EDIT: This is obviously more about system changes, not file changes to websites, as those can easily be scheduled to rsync over ssh.


Last edited by OtherMDesign; 03-24-2013 at 02:52 PM.


Sponsored Links
  #2  
Old
Web Hosting Guru
 
Join Date: Jun 2012
Location: Saskatchewan, Canada
Posts: 300
Since you're asking mostly regarding config files, why not set up a cron job to snap /etc into a tarball and set it in /etc-backup/ with timestamp as filename.

This way you could just untar the tarball to replace over /etc. You vcan also use rsync/ssh to backup /etc-backup to a remote location as well.

Would this suffice? Or do you really need the whole FS snapshotted?

  #3  
Old
WHT Addict
 
Join Date: Oct 2002
Posts: 112
Backing up /etc is definitely a good start. Though sometimes installing/upgrading packages changes stuff in /usr/lib, /usr/share, etc.

In all my Linux experience, doing an apt-get upgrade on an LTS install has never toasted anything ever. Just trying to be on the safe side. But backing up the domain folders & /etc should probably cover me.

Sponsored Links
  #4  
Old
Web Hosting Guru
 
Join Date: Jun 2012
Location: Saskatchewan, Canada
Posts: 300
I run Gentoo for everything. Backup /etc and /var usually covers everything. All of the package manager files are in /var on Gentoo. So if I have to rebuild the system, I can rebuild apps from package info in /var to get it to the same setup I had, then untar /etc backup over /etc.

I suppose it depends on where your web root is. I always custom configure everything by hand and use /www for web sites.

apt-get... is that ubuntu or debian?


Last edited by evohost Canada; 03-24-2013 at 03:43 PM. Reason: spelling
  #5  
Old
Junior Guru Wannabe
 
Join Date: Jan 2008
Location: In home
Posts: 57
make rsync to one backup folder, better this way.

  #6  
Old
WHT Addict
 
Join Date: Oct 2002
Posts: 112
Running Ubuntu 12.04.

  #7  
Old
Web Hosting Guru
 
Join Date: Jun 2012
Location: Saskatchewan, Canada
Posts: 300
With ubuntu I think you'll be fine with backup your domain data and /etc.

Anything in /usr/share and /usr/lib should not affect in terms of backup and restore. If you're running into issues with changes in these directories, you'll need to roll back any updated packages, then just reapply etc by untar over the directory.

One thing I'm not certain about on Ubuntu/Debian, is where databases are stored. On Gentoo they are in /var by default. How do you handle your database backups?

  #8  
Old
WHT Addict
 
Join Date: Oct 2002
Posts: 112
Are you talking about actual databases (like MySQL)? Almost forgot about that! Looks like this could work: http://www.cyberciti.biz/faq/ubuntu-...backup-script/

I'd also back up /var as well, which has other misc data.

  #9  
Old
Web Hosting Guru
 
Join Date: Jun 2012
Location: Saskatchewan, Canada
Posts: 300
That script looks useful, but be careful. It requires you to place your root mysql password in plaintext in the script itself. Be sure to save it in /root/ and set permissions to only be read by root user.

  #10  
Old
WHT Addict
 
Join Date: Oct 2002
Posts: 112
Yep, as soon as I saw it has plaintext passwords in it, I thought "chown root" and "chmod go="

  #11  
Old
Temporarily Suspended
 
Join Date: Jan 2010
Location: Europe
Posts: 367
Lightbulb

Backup mysql, and files separatelly by cron, when this finishes let cron backup the archives into external ftp. when done, delete source archoves.

  #12  
Old
Aspiring Evangelist
 
Join Date: Jul 2012
Posts: 386
Quote:
Originally Posted by OtherMDesign View Post
Hey guys,

So let's say I'm on a VPS that does weekly backups, but want more control over restoring in case of catastrophe. What is a recommended way of doing my own snapshots? I'm worried about instances where I modify a couple .conf files the wrong way, or I do an apt-get upgrade and it breaks something, and I need to jump back to a previous snapshot. On RamNode, for instance, you can do a snapshot which is great, and it drops a tarball in /panelbackup of the whole filesystem. But there's no way to just say "wipe out my entire system and replace it completely with this snapshot." At least not that I know of.

Any info would be appreciated!

EDIT: This is obviously more about system changes, not file changes to websites, as those can easily be scheduled to rsync over ssh.
Currently my backups are crude and simple, but I have successfully backed-up, wiped, and then restored several VPSs using tar. I think it might be the same as your /panelbackup, except I use /backup instead.

See:
http://www.webhostingtalk.com/showthread.php?t=1215449
...and post 15 and 16 in this thread:
http://www.webhostingtalk.com/showthread.php?t=1224354

I use two VPSs to store each other's backups. I use SFTP to copy the files from one to another, but SCP will do nicely, too. I revised my backup/restore commands slightly:

Backup:
tar cvzpf /backup/backup.tgz --same-owner --exclude=/backup/* --exclude=/proc/* --exclude=/dev/* --exclude=/mnt/* --exclude=/sys/* --exclude=/tmp/* / 2>/backup/error.log

(The new command excludes anything in the /backup directory - including older, renamed backups, and backups copied from other VPSs.)

Restore:
tar -xvpzf /backup/backup.tgz -C /

To do the restore, I would re-install from the same image as before, then patch it to the same level as the backup. After copying the tar file to a newly created /backup directory, run the Restore command above - it will overwrite everything, of course. After that, reboot.

One time, I had an issue where the restored system would boot, but not communicate on the network. The problem was that I had to do an update/upgrade cycle (latest patches), then run the restore. I can see how it might an issue to get a working restore of an older backup if neither the original install image or the latest patches are not compatible with the restore files from the tarball.

  #13  
Old
Web Hosting Master
 
Join Date: Nov 2004
Posts: 567
If you're on a KVM plan with RamNode, you could sign up with an R1Soft backup provider and start backing up your whole VPS, in whatever intervals you want (we do hourly backups for instance).

So if something happens, you can either retrieve a single file/folder from your backups (from any point back in time) directly to your VPS - this would be the case you want to retrieve a conf file or something OR you can do a Bare Metal Restore by booting up your VPS using R1Soft's recovery disk (you can ask RamNode to add the ISO to their list) and restore your whole VPS exactly as it was x hours/days/weeks ago.

Note: In order for BMR to work, you need to be running your KVM VPS using the ide disk driver, Virtio is not compatible yet.

__________________
Fusioned - http://www.fusioned.net
Enterprise Hosting | CloudLinux, cPanel, LiteSpeed, R1Soft | PHP 5.2, 5.3, 5.4 & 5.5 | Softaculous | CloudFlare
SSD KVM VPS in Netherlands | SolusVM | Intel E3-1230v2 | LSI RAID-10 SSD | 1Gbps | IPv6 ready

  #14  
Old
Community Liaison
 
Join Date: Mar 2003
Posts: 11,380
Quote:
Originally Posted by George_Fusioned View Post
If you're on a KVM plan with RamNode, you could sign up with an R1Soft backup provider and start backing up your whole VPS, in whatever intervals you want (we do hourly backups for instance).
The easiest way to do it and you can restore your entire VPS in no time.

__________________
.
JoneSolutions.Com + SSS = Your Number One Choice On The Net - since 2001

It's Fully Managed and Secured. Ask us at sales @ jonesolutions.com .

  #15  
Old
WHT Addict
 
Join Date: Oct 2002
Posts: 112
Thanks for the help, vps_newbie!

And I'm on the OpenVZ setup with RamNode, so R1Soft may not work in this case.

Reply

Similar Threads
Thread Thread Starter Forum Replies Last Post
when RAID10 +backup is not enough, do you use snapshot backup? Peter-SexyWing Colocation and Data Centers 4 12-19-2010 01:03 PM
Future Hosting - VPS BLOWOUT! - 50% off, Free Security and Snapshot Backup! futurehosting VPS Hosting Offers 0 03-19-2007 08:55 AM
Future Hosting - VPS BLOWOUT! - 50% off, Free Security and Snapshot Backup! futurehosting VPS Hosting Offers 23 03-19-2007 07:25 AM
Future Hosting - VPS BLOWOUT! - 50% off, Free Security and Snapshot Backup! futurehosting VPS Hosting Offers 20 03-09-2007 12:42 AM
VPS backup or snapshot NelsonT VPS Hosting 2 11-28-2006 02:02 PM

Related posts from TheWhir.com
Title Type Date Posted
LeaseWeb Netherlands Chosen to Host 20 Years Worth of Debian Linux Distributions Web Hosting News 2014-10-15 00:22:01
Symantec to Discontinue Backup Exec.Cloud; Customers Presented with Next-Step Options Web Hosting News 2013-12-03 14:49:46
Malwarebytes Launches Data Scan-and-Backup Service Web Hosting News 2013-05-07 14:51:03
Sterling Data Storage Launches Three Cloud Backup Services Web Hosting News 2013-01-14 13:39:31
Web Host 1&1 Internet Adds Server Restoration Tool for Virtual Machines Web Hosting News 2012-11-07 15:45:16


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
WHT Host Brief Email:

We respect your privacy. We will never sell, rent, or give away your address to any outside party, ever.

Advertisement:
Web Hosting News:
WHT Membership
WHT Membership



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?