{"id":1987,"date":"2026-01-28T04:13:56","date_gmt":"2026-01-28T04:13:56","guid":{"rendered":"https:\/\/veerhost.com\/docs\/vps\/how-to-back-up-your-vps-snapshots-vs-file-backups\/"},"modified":"2026-03-31T17:54:49","modified_gmt":"2026-03-31T17:54:49","slug":"how-to-back-up-your-vps-snapshots-vs-file-backups","status":"publish","type":"docs","link":"https:\/\/veerhost.com\/de\/docs\/vps\/how-to-back-up-your-vps-snapshots-vs-file-backups\/","title":{"rendered":"How to Back Up Your VPS (Snapshots vs File Backups)"},"content":{"rendered":"<p class=\"wp-block-paragraph\">Backups are the most important thing you can set up on a VPS \u2014 and they&#8217;re also the most ignored until something breaks. This guide covers all three backup strategies for your VeerHost VPS: VeerHost snapshots, manual file backups, and automated daily backups using cron.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Method 1: VeerHost Control Panel Snapshots<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The fastest way to create a full backup. A snapshot captures the entire disk state at that moment \u2014 OS, configs, files, and databases.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Log in to your VeerHost client area<\/li>\n<li>Go to <strong>Services &gt; My VPS<\/strong><\/li>\n<li>Click <strong>Snapshots<\/strong> and create a new snapshot<\/li>\n<li>To restore, select the snapshot and click <strong>Restore<\/strong><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Best for:<\/strong> Before major changes (OS updates, new software installs, config changes). Always take a snapshot before anything risky.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Method 2: Manual File Backup with tar<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Create a compressed archive of your website files or any directory:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Backup a website directory\ntar -czvf \/root\/backup-$(date +%Y-%m-%d).tar.gz \/var\/www\/yourdomain.com<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">List the contents of a backup to verify it:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tar -tzvf \/root\/backup-2026-03-31.tar.gz | head -20<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Restore from the backup:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tar -xzvf \/root\/backup-2026-03-31.tar.gz -C \/<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Method 3: MySQL Database Backup<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Always back up databases separately from files. File backups do not include MySQL data.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Backup a single database:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mysqldump -u root -p mywebsite > \/root\/mywebsite-$(date +%Y-%m-%d).sql<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Backup all databases:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mysqldump -u root -p --all-databases > \/root\/all-databases-$(date +%Y-%m-%d).sql<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Restore a database:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mysql -u root -p mywebsite < \/root\/mywebsite-2026-03-31.sql<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Method 4: Download Backup to Your Local Machine<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A backup stored on the same VPS it came from is not a real backup. Download it to your local computer:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Run this on your LOCAL machine (not the server)\nscp root@YOUR_VPS_IP:\/root\/backup-2026-03-31.tar.gz ~\/Downloads\/<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Or use <code>rsync<\/code> for incremental backups (only copies changed files):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>rsync -avz root@YOUR_VPS_IP:\/var\/www\/ ~\/vps-backups\/www\/<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Method 5: Automated Daily Backups with Cron<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Create a backup script and schedule it to run automatically every night:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nano \/root\/backup.sh<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Paste this script:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/bin\/bash\nDATE=$(date +%Y-%m-%d)\nBACKUP_DIR=\/root\/backups\n\nmkdir -p $BACKUP_DIR\n\n# Backup website files\ntar -czvf $BACKUP_DIR\/www-$DATE.tar.gz \/var\/www\/\n\n# Backup MySQL databases\nmysqldump -u root -pYOUR_MYSQL_PASSWORD --all-databases > $BACKUP_DIR\/mysql-$DATE.sql\n\n# Delete backups older than 7 days\nfind $BACKUP_DIR -name \"*.tar.gz\" -mtime +7 -delete\nfind $BACKUP_DIR -name \"*.sql\" -mtime +7 -delete\n\necho \"Backup completed: $DATE\"<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Make it executable and test it:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>chmod +x \/root\/backup.sh\n\/root\/backup.sh<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Schedule it to run daily at 2 AM via cron:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>crontab -e<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Add this line at the bottom:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>0 2 * * * \/root\/backup.sh >> \/root\/backup.log 2>&1<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Snapshots vs File Backups: Which to Use?<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th><\/th><th>Snapshots<\/th><th>File Backups<\/th><\/tr><\/thead><tbody><tr><td>What's included<\/td><td>Full disk (OS + files + DB)<\/td><td>Only what you specify<\/td><\/tr><tr><td>Speed to create<\/td><td>Fast (minutes)<\/td><td>Depends on size<\/td><\/tr><tr><td>Speed to restore<\/td><td>Fast (full restore)<\/td><td>Manual restore<\/td><\/tr><tr><td>Off-server copy<\/td><td>Stored by VeerHost<\/td><td>Must download yourself<\/td><\/tr><tr><td>Best for<\/td><td>Before risky changes<\/td><td>Daily automated backups<\/td><\/tr><\/tbody><\/table><\/figure>","protected":false},"excerpt":{"rendered":"<p>Backups are the most important thing you can set up on a VPS \u2014 and they&#8217;re also the most ignored until something [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":1967,"menu_order":6,"comment_status":"open","ping_status":"closed","template":"","doc_tag":[],"class_list":["post-1987","docs","type-docs","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/veerhost.com\/de\/wp-json\/wp\/v2\/docs\/1987","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/veerhost.com\/de\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/veerhost.com\/de\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/veerhost.com\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/veerhost.com\/de\/wp-json\/wp\/v2\/comments?post=1987"}],"version-history":[{"count":3,"href":"https:\/\/veerhost.com\/de\/wp-json\/wp\/v2\/docs\/1987\/revisions"}],"predecessor-version":[{"id":2285,"href":"https:\/\/veerhost.com\/de\/wp-json\/wp\/v2\/docs\/1987\/revisions\/2285"}],"up":[{"embeddable":true,"href":"https:\/\/veerhost.com\/de\/wp-json\/wp\/v2\/docs\/1967"}],"wp:attachment":[{"href":"https:\/\/veerhost.com\/de\/wp-json\/wp\/v2\/media?parent=1987"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/veerhost.com\/de\/wp-json\/wp\/v2\/doc_tag?post=1987"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}