Backups: Restoring with JetBackup on Shared Hosting and Manual Backups on a VPS
On Cloudesta shared hosting, you restore files, databases, email accounts or a whole account from cPanel → JetBackup 5: pick a backup date, then click Restore or Download. On a Cloud VPS, nothing is backed up unless you set it up. Dump your databases with mysqldump or pg_dump, archive your files with tar, run the job nightly from cron and copy the results off the server with rclone or scp. This guide covers both setups, plus how to test a restore before you actually need one.
Prerequisites
- Shared hosting: your cPanel login.
- VPS: root or sudo SSH access on Ubuntu 22.04 or 24.04.
- VPS: off-server storage, such as an S3-compatible bucket or a second server reachable over SSH.
1. How do I restore my cPanel account with JetBackup?
Log in to cPanel and open JetBackup 5. It is usually in the Files section or in its own JetBackup section. The menu lists backups by type. Labels can differ slightly between JetBackup versions. Restores are queued, and you can follow their progress on the Queue page.
Restore the full account
Open Full Account Backups, select a date and click Restore. This replaces your current files, databases and email with the backup copy.
Restore the home directory or a single file
Open File Backups and select a date. To restore everything, click Restore. To restore specific items, use the file selection option (Change Files Selection), browse to the file or folder, tick it and then restore. Only the selected paths are replaced.
Restore a database
Open Database Backups, tick the database (for example user_wp), choose the date and click Restore. The current contents of that database are replaced. If the database user is also missing, restore it from the database users backup type as well.
Restore an email account
Open Email Backups, tick the mailbox (for example info@example.com), pick a date and click Restore. If the mailbox was deleted, recreate it in Email Accounts first.
Download a backup and understand retention
Select any backup and click Download. JetBackup builds an archive in the background, and a download link appears once it is ready.
The dates you see are all the restore points that exist. How many there are depends on your plan's backup schedule, and older copies cannot be recreated. If you need longer history, download copies yourself regularly. Our shared hosting plans list the backup schedule for each tier.
2. What should I back up on a VPS?
- Web root: usually
/var/www. - Databases: always as dumps. Copying
/var/lib/mysqlwhile MySQL is running produces an inconsistent copy. - /etc: Nginx/Apache, PHP, SSL and cron configuration.
- Docker volumes and compose files: for example the n8n data volume on n8n hosting.
3. How do I schedule nightly VPS backups with cron?
Create the script at /usr/local/sbin/site-backup.sh. It does the following:
- Dumps each MySQL/MariaDB database separately, so you can restore just one.
- Dumps PostgreSQL in custom format.
- Archives your files while skipping caches.
- Saves a Docker volume.
- Deletes local copies older than 7 days.
Delete the parts you don't use.
#!/usr/bin/env bash
set -euo pipefail
DEST=/var/backups/site/$(date +%F)
mkdir -p "$DEST"
# MySQL / MariaDB (root uses socket auth on Ubuntu)
for db in $(mysql -N -e "SHOW DATABASES" | grep -Ev '^(information_schema|performance_schema|sys)$'); do
mysqldump --single-transaction --quick --routines --triggers "$db" | gzip > "$DEST/mysql-$db.sql.gz"
done
# PostgreSQL (one database)
runuser -u postgres -- pg_dump -Fc mydb > "$DEST/pg-mydb.dump"
# Files, skipping caches and dependencies
tar --exclude='*/cache/*' --exclude='*/node_modules' --exclude='*.log' \
-czf "$DEST/files.tar.gz" /var/www /etc /opt/n8n
# Docker volume (check names with: docker volume ls)
docker run --rm -v n8n_data:/data:ro -v "$DEST":/backup alpine \
tar -czf /backup/n8n_data.tar.gz -C /data .
# Keep 7 days locally
find /var/backups/site -mindepth 1 -maxdepth 1 -type d -mtime +7 -exec rm -rf {} +
Make the script executable, then schedule it for 02:30 every night:
sudo chmod 700 /usr/local/sbin/site-backup.sh
echo '30 2 * * * root /usr/local/sbin/site-backup.sh >> /var/log/site-backup.log 2>&1' | sudo tee /etc/cron.d/site-backup
4. How do I copy backups off the server?
A backup stored only on the VPS it protects is lost together with that VPS. For S3-compatible object storage, install rclone and create a remote named offsite:
sudo apt update && sudo apt install -y rclone
sudo rclone config
Then add one of these lines to the end of the script. The first copies to object storage with rclone. The second copies to another server with scp, and needs SSH key login set up for root.
rclone copy /var/backups/site offsite:my-bucket/server1
scp -r "$DEST" backup@203.0.113.20:/srv/backups/server1/
If your bucket supports lifecycle or retention rules, enable them. That way old copies expire automatically, and a compromised server cannot delete history it shouldn't touch.
5. How do I restore a VPS backup step by step?
Step 1: fetch the backup and unpack it into a temporary folder. Don't extract it straight over /.
rclone copy offsite:my-bucket/server1/2025-01-15 /root/restore
mkdir -p /root/restore/files
tar -xzf /root/restore/files.tar.gz -C /root/restore/files
Step 2: copy the files back and fix ownership.
sudo rsync -a /root/restore/files/var/www/example.com/ /var/www/example.com/
sudo chown -R www-data:www-data /var/www/example.com
Step 3: restore the databases. The first line restores a MySQL/MariaDB database. The second restores a PostgreSQL database.
gunzip < /root/restore/mysql-wordpress.sql.gz | sudo mysql wordpress
sudo -u postgres pg_restore --clean --if-exists -d mydb /root/restore/pg-mydb.dump
Step 4: restore the Docker volume. Stop the container first:
cd /opt/n8n && docker compose stop
docker run --rm -v n8n_data:/data -v /root/restore:/backup alpine \
sh -c "cd /data && tar -xzf /backup/n8n_data.tar.gz"
docker compose start
6. Can Cloudesta snapshot my server before risky changes?
Yes. Before an OS upgrade, a major migration or a control-panel install, open a support ticket and ask for a snapshot of your Cloud VPS. Include a preferred time. Snapshot restores are also requested by ticket.
A snapshot is a short-term safety net. It does not replace your own backups.
Follow the 3-2-1 rule:
- Keep 3 copies of your data.
- Store them on 2 different kinds of storage.
- Keep 1 copy off-site.
If you would rather not maintain scripts yourself, Cloudesta's managed Full Backup service handles scheduling, off-site storage and restores for you. Ask about it in a ticket.
Verify it works
Run the script once by hand and check the log. Then check that the archives are readable and restore one database into a scratch database:
sudo /usr/local/sbin/site-backup.sh && tail /var/log/site-backup.log
ls -lh /var/backups/site/$(date +%F)
gzip -t /var/backups/site/$(date +%F)/*.gz && echo "archives OK"
tar -tzf /var/backups/site/$(date +%F)/files.tar.gz | head
sudo mysql -e "CREATE DATABASE restore_test"
gunzip < /var/backups/site/$(date +%F)/mysql-wordpress.sql.gz | sudo mysql restore_test
sudo mysql -e "SHOW TABLES FROM restore_test; DROP DATABASE restore_test"
Finally, run rclone ls offsite:my-bucket/server1 and confirm today's folder is there. Repeat this test restore at least once a month.
Common problems
- Backups are too large or fill the disk. Run
sudo du -sh /var/www/* | sort -hto find the bulk. Add--excluderules for caches, logs and old uploads, and lower the local retention in thefindline. - The site freezes while mysqldump runs.
--single-transactiononly avoids locks on InnoDB tables. Convert MyISAM tables to InnoDB, and schedule the job off-peak. - The site shows 403 errors or can't write uploads after a restore. Ownership was lost. Run
sudo chown -R www-data:www-data /var/www/example.com, thenfind /var/www/example.com -type d -exec chmod 755 {} +andfind /var/www/example.com -type f -exec chmod 644 {} +. - mysqldump reports "Access denied" in cron. The job must run as root, which uses socket auth. Alternatively, put the credentials in
/root/.my.cnfwithchmod 600. - The JetBackup date you need is missing. It has passed the retention period and cannot be recreated. Restore the closest available date, or open a ticket to check for server-level copies.
Frequently asked questions
Does restoring with JetBackup delete my newer files?
Only the items you restore are overwritten with the backup version. Restore a single file or database when you can, and avoid full account restores unless you need one.
Is my Cloud VPS backed up automatically?
No. On a VPS, backups are your responsibility unless you set up the scripts above or use Cloudesta's managed Full Backup service.
Is a snapshot enough as a backup?
No. A snapshot is a quick rollback point stored with the server. Keep regular off-site backups as well, following the 3-2-1 rule.
Need help? For a restore you can't complete, a snapshot request or help setting up backups, open a support ticket from your client area.