Skip to main content

Backup & Snapshots

Protect your data and ensure business continuity with Lineserve's comprehensive backup and snapshot solutions. Create point-in-time backups of your VPS instances and block storage volumes.

Overviewโ€‹

Lineserve provides multiple backup options:

  • VPS Snapshots: Complete system backups of your virtual servers
  • Volume Snapshots: Point-in-time backups of block storage volumes
  • Automated Backups: Scheduled backups with retention policies
  • Cross-Region Replication: Disaster recovery across data centers

VPS Snapshotsโ€‹

What are VPS Snapshots?โ€‹

VPS snapshots capture the complete state of your virtual server, including:

  • Operating system and all installed software
  • Application data and configurations
  • System settings and user accounts
  • Network configurations

Creating VPS Snapshotsโ€‹

Via Dashboardโ€‹

  1. Navigate to Compute > VPS Instances
  2. Select your VPS instance
  3. Click Actions > Create Snapshot
  4. Enter snapshot name and description
  5. Click Create Snapshot

Via CLIโ€‹

# Create a snapshot of VPS instance
lineserve compute create-snapshot \
--instance-id vps-12345678 \
--name "production-backup-2024-01-15" \
--description "Pre-deployment backup"

# List all snapshots
lineserve compute list-snapshots

# Create snapshot with power-off (recommended for consistency)
lineserve compute create-snapshot \
--instance-id vps-12345678 \
--name "consistent-backup" \
--power-off

Via APIโ€‹

curl -X POST \
https://api.lineserve.com/v1/compute/snapshots \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"instance_id": "vps-12345678",
"name": "api-backup",
"description": "Backup created via API",
"power_off": false
}'

Restoring from VPS Snapshotsโ€‹

Create New VPS from Snapshotโ€‹

# Launch new VPS from snapshot
lineserve compute create-instance \
--snapshot-id snap-87654321 \
--plan standard-2 \
--name "restored-server" \
--region us-east-1

Restore Existing VPSโ€‹

# Restore VPS to previous snapshot state
lineserve compute restore-instance \
--instance-id vps-12345678 \
--snapshot-id snap-87654321 \
--confirm

Volume Snapshotsโ€‹

Creating Volume Snapshotsโ€‹

# Create snapshot of block storage volume
lineserve compute create-volume-snapshot \
--volume-id vol-12345678 \
--name "database-backup-2024-01-15"

# Create snapshot with metadata
lineserve compute create-volume-snapshot \
--volume-id vol-12345678 \
--name "pre-upgrade-backup" \
--tags "environment=production,type=database"

Restoring Volume Snapshotsโ€‹

# Create new volume from snapshot
lineserve compute create-volume \
--snapshot-id volsnap-87654321 \
--name "restored-database" \
--size 100

# Restore existing volume (destructive operation)
lineserve compute restore-volume \
--volume-id vol-12345678 \
--snapshot-id volsnap-87654321 \
--confirm

Automated Backupsโ€‹

Setting Up Automated Backupsโ€‹

VPS Automated Backupsโ€‹

# Enable daily backups with 7-day retention
lineserve compute enable-auto-backup \
--instance-id vps-12345678 \
--frequency daily \
--retention 7 \
--time "02:00"

# Enable weekly backups
lineserve compute enable-auto-backup \
--instance-id vps-12345678 \
--frequency weekly \
--retention 4 \
--day sunday \
--time "03:00"

Volume Automated Backupsโ€‹

# Schedule volume snapshots
lineserve compute schedule-volume-snapshots \
--volume-id vol-12345678 \
--frequency daily \
--retention 14 \
--time "01:00"

Backup Policiesโ€‹

{
"name": "production-backup-policy",
"schedule": {
"frequency": "daily",
"time": "02:00",
"timezone": "UTC"
},
"retention": {
"daily": 7,
"weekly": 4,
"monthly": 12
},
"options": {
"power_off": false,
"consistent": true,
"compress": true
}
}

Cross-Region Replicationโ€‹

Setting Up Cross-Region Backupsโ€‹

# Replicate snapshots to another region
lineserve compute replicate-snapshot \
--snapshot-id snap-12345678 \
--target-region eu-west-1 \
--name "dr-backup-eu"

# Enable automatic cross-region replication
lineserve compute enable-cross-region-backup \
--instance-id vps-12345678 \
--target-region eu-west-1 \
--frequency daily

Backup Best Practicesโ€‹

๐Ÿ”„ Regular Backup Scheduleโ€‹

  • Critical Systems: Daily backups with 30-day retention
  • Development: Weekly backups with 4-week retention
  • Archives: Monthly backups with 1-year retention

๐Ÿ“Š Testing Backup Integrityโ€‹

# Test restore process regularly
lineserve compute test-restore \
--snapshot-id snap-12345678 \
--instance-type test-small \
--auto-terminate 1h

๐Ÿท๏ธ Backup Naming Conventionโ€‹

# Use consistent naming patterns
BACKUP_NAME="prod-web-$(date +%Y%m%d-%H%M)"
lineserve compute create-snapshot \
--instance-id vps-12345678 \
--name "$BACKUP_NAME"

๐Ÿ” Security Considerationsโ€‹

  • Enable encryption for sensitive data
  • Use IAM policies to control backup access
  • Regular audit of backup permissions
  • Secure backup storage locations

Monitoring & Alertsโ€‹

Backup Monitoringโ€‹

# Monitor backup status
lineserve compute list-snapshots \
--instance-id vps-12345678 \
--status failed

# Set up backup failure alerts
lineserve monitoring create-alert \
--type backup-failure \
--notification email:admin@company.com \
--notification slack:ops-channel

Backup Metricsโ€‹

  • Backup success/failure rates
  • Backup duration and size
  • Storage usage and costs
  • Recovery time objectives (RTO)

Disaster Recoveryโ€‹

Creating a DR Planโ€‹

1. Identify Critical Systemsโ€‹

# Tag critical instances
lineserve compute tag-instance \
--instance-id vps-12345678 \
--tags "criticality=high,backup-priority=1"

2. Set Recovery Objectivesโ€‹

  • RTO (Recovery Time Objective): Maximum downtime
  • RPO (Recovery Point Objective): Maximum data loss
  • RTA (Recovery Time Actual): Actual recovery time

3. Automate Recovery Processโ€‹

#!/bin/bash
# Disaster recovery script
SNAPSHOT_ID="snap-latest-prod"
DR_REGION="eu-west-1"

# Launch recovery instance
lineserve compute create-instance \
--snapshot-id $SNAPSHOT_ID \
--plan standard-4 \
--region $DR_REGION \
--name "dr-recovery-$(date +%Y%m%d)"

Backup Pricingโ€‹

VPS Snapshotsโ€‹

Snapshot SizePrice per GB/month
First 10 GBFree
10-100 GB$0.05
100GB+$0.03

Volume Snapshotsโ€‹

Storage TypePrice per GB/month
Standard$0.05
High Performance$0.08
Archive$0.02

Cross-Region Replicationโ€‹

  • Data transfer: $0.09 per GB
  • Storage in target region: Standard rates apply

Backup Automation Scriptsโ€‹

Daily Backup Scriptโ€‹

#!/bin/bash
# daily-backup.sh

INSTANCE_ID="vps-12345678"
DATE=$(date +%Y%m%d)
BACKUP_NAME="daily-backup-$DATE"

# Create snapshot
SNAPSHOT_ID=$(lineserve compute create-snapshot \
--instance-id $INSTANCE_ID \
--name $BACKUP_NAME \
--output json | jq -r '.snapshot_id')

# Wait for completion
lineserve compute wait-snapshot-complete --snapshot-id $SNAPSHOT_ID

# Clean up old backups (keep last 7)
lineserve compute delete-old-snapshots \
--instance-id $INSTANCE_ID \
--keep 7 \
--pattern "daily-backup-*"

echo "Backup completed: $SNAPSHOT_ID"

Database Backup Integrationโ€‹

#!/bin/bash
# database-backup.sh

# Stop database writes (optional)
sudo systemctl stop postgresql

# Create consistent snapshot
lineserve compute create-snapshot \
--instance-id vps-database \
--name "db-backup-$(date +%Y%m%d-%H%M)" \
--power-off false

# Restart database
sudo systemctl start postgresql

# Export database separately
pg_dump myapp | gzip > /tmp/db-export-$(date +%Y%m%d).sql.gz

# Upload to object storage
lineserve storage upload /tmp/db-export-*.sql.gz s3://backups/database/

Troubleshootingโ€‹

Common Issuesโ€‹

Snapshot Creation Fails

  • Check available storage quota
  • Verify instance is running
  • Review system logs for errors

Slow Backup Performance

  • Consider power-off snapshots for consistency
  • Check system I/O during backup
  • Use incremental backups when available

Restore Failures

  • Verify snapshot integrity
  • Check target region availability
  • Ensure sufficient resources

Recovery Testingโ€‹

# Regular recovery testing
lineserve compute test-recovery \
--snapshot-id snap-12345678 \
--test-plan basic \
--notify-results admin@company.com

API Referenceโ€‹

Snapshot Managementโ€‹

Create Snapshotโ€‹

POST /v1/compute/snapshots
{
"instance_id": "vps-12345678",
"name": "backup-name",
"description": "Backup description",
"power_off": false
}

List Snapshotsโ€‹

GET /v1/compute/snapshots?instance_id=vps-12345678

Delete Snapshotโ€‹

DELETE /v1/compute/snapshots/{snapshot-id}

Automated Backupโ€‹

Enable Auto-Backupโ€‹

POST /v1/compute/instances/{instance-id}/auto-backup
{
"frequency": "daily",
"retention": 7,
"time": "02:00"
}

Next Stepsโ€‹