Results 1 to 18 of 18
-
03-24-2013, 02:48 PM #1Junior Guru
- Join Date
- Oct 2002
- Posts
- 227
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.
-
03-24-2013, 03:20 PM #2Web Hosting Evangelist
- Join Date
- Jun 2012
- Location
- Saskatchewan, Canada
- Posts
- 478
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?
-
03-24-2013, 03:28 PM #3Junior Guru
- Join Date
- Oct 2002
- Posts
- 227
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.
-
03-24-2013, 03:37 PM #4Web Hosting Evangelist
- Join Date
- Jun 2012
- Location
- Saskatchewan, Canada
- Posts
- 478
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
-
03-24-2013, 03:40 PM #5Junior Guru Wannabe
- Join Date
- Jan 2008
- Location
- In home
- Posts
- 61
make rsync to one backup folder, better this way.
-
03-24-2013, 03:42 PM #6Junior Guru
- Join Date
- Oct 2002
- Posts
- 227
Running Ubuntu 12.04.
-
03-24-2013, 03:52 PM #7Web Hosting Evangelist
- Join Date
- Jun 2012
- Location
- Saskatchewan, Canada
- Posts
- 478
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?
-
03-24-2013, 04:22 PM #8Junior Guru
- Join Date
- Oct 2002
- Posts
- 227
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.
-
03-24-2013, 04:32 PM #9Web Hosting Evangelist
- Join Date
- Jun 2012
- Location
- Saskatchewan, Canada
- Posts
- 478
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.
-
03-24-2013, 04:37 PM #10Junior Guru
- Join Date
- Oct 2002
- Posts
- 227
Yep, as soon as I saw it has plaintext passwords in it, I thought "chown root" and "chmod go="
-
03-24-2013, 07:36 PM #11Temporarily Suspended
- Join Date
- Jan 2010
- Location
- Europe
- Posts
- 372
Backup mysql, and files separatelly by cron, when this finishes let cron backup the archives into external ftp. when done, delete source archoves.
-
03-24-2013, 09:10 PM #12Web Hosting Master
- Join Date
- Jul 2012
- Posts
- 842
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.
-
03-24-2013, 09:26 PM #13Web Hosting Master
- Join Date
- Nov 2004
- Posts
- 654
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 & Semi-Dedicated Hosting | CloudLinux, cPanel, LiteSpeed, Acronis | PHP 5.6, 7.2, 7.3, 7.4 & 8.0
█ Fully Managed SSD KVM VPS & Dedicated Servers | CloudFlare & Acronis Partner | RIPE LIR
-
03-24-2013, 09:32 PM #14The Linux Specialist
- Join Date
- Mar 2003
- Location
- /root
- Posts
- 23,991
Specially 4 U
Reseller Hosting: Boost Your Websites | Fully Managed KVM VPS: 3.20 - 5.00 Ghz, Pure Dedicated Power
JoneSolutions.Com is on the net 24/7 providing stable and reliable web hosting solutions, server management and services since 2001
Debian|Ubuntu|cPanel|DirectAdmin|Enhance|Webuzo|Acronis|Estela|BitNinja|Nginx
-
03-24-2013, 09:34 PM #15Junior Guru
- Join Date
- Oct 2002
- Posts
- 227
Thanks for the help, vps_newbie!
And I'm on the OpenVZ setup with RamNode, so R1Soft may not work in this case.
-
03-24-2013, 10:51 PM #16Solid State
- Join Date
- Aug 2010
- Posts
- 1,687
Let us know if we can do anything to help!
██ RamNode - High Performance Cloud VPS
██ SSD Cloud and Shared Hosting
██ NYC - LA - ATL - SEA - NL - DDoS Protection - AS3842
██ Deploy on our SSD cloud today! - www.ramnode.com
-
03-24-2013, 11:23 PM #17Junior Guru
- Join Date
- Oct 2002
- Posts
- 227
Nick: I try not to bother you guys too much as I know it's an unmanaged service. I know a lot of the limitations are due to the SolusVM panel. In an ideal world, it would be nice to be able to shut the server down, and restore a quick backup to overwrite the entire filesystem, then boot it back up.
But some other people have made some great suggestions and I'm sure I can put together an automated backup that will tackle the important folders as well as my MySQL DBs.
Thanks!
-
03-24-2013, 11:25 PM #18Solid State
- Join Date
- Aug 2010
- Posts
- 1,687
I believe SolusVM is planning to launch a manual, remote backup system with the next beta. It was due out last Monday so who knows when that will happen...
██ RamNode - High Performance Cloud VPS
██ SSD Cloud and Shared Hosting
██ NYC - LA - ATL - SEA - NL - DDoS Protection - AS3842
██ Deploy on our SSD cloud today! - www.ramnode.com
Similar Threads
-
when RAID10 +backup is not enough, do you use snapshot backup?
By Peter-SexyWing in forum Colocation, Data Centers, IP Space and NetworksReplies: 4Last Post: 12-19-2010, 01:03 PM -
Future Hosting - VPS BLOWOUT! - 50% off, Free Security and Snapshot Backup!
By futurehosting in forum VPS Hosting OffersReplies: 0Last Post: 03-19-2007, 08:55 AM -
Future Hosting - VPS BLOWOUT! - 50% off, Free Security and Snapshot Backup!
By futurehosting in forum VPS Hosting OffersReplies: 23Last Post: 03-19-2007, 07:25 AM -
Future Hosting - VPS BLOWOUT! - 50% off, Free Security and Snapshot Backup!
By futurehosting in forum VPS Hosting OffersReplies: 20Last Post: 03-09-2007, 12:42 AM -
VPS backup or snapshot
By NelsonT in forum VPS HostingReplies: 2Last Post: 11-28-2006, 02:02 PM