Backup Plans

From Virtualizor Wiki
Jump to: navigation, search

Overview

Backup plans enable you to create different VPS backup settings for different VPS on the same server(s). You can assign backup plans to individual VPS or to the entire VPS plan.

You can also allow the endusers to initiate backup/restore of their VPS at their will in the backup plan.

Virtualizor provides 3 ways to backup the VPS. FTP, SSH and Local Backup.

This guide shows how to setup a backup plan for a server. There are mainly 3 steps involved in this :

  • Setting up the FTP server or SSH Server.
  • Creating the backup plan.
  • Assigning the backup plan to a VPS

Setting up the FTP/SSH server

You will need to add the Backup server where the backups will take place. To do so go to :

Virtualizor Admin Panel -> Servers -> Add backup server

Select the Backup server type(SSH and FTP) and enter the server credentials.

Note :- If you choose FTP, you will be able to configure setting only if FTP backup server is configured.

Creating the backup plan

After adding the backup server you will need to create a backup plan.

Virtualizor Admin Panel -> Plans (Menu) -> Add Backup Plan

The following screen will appear :

Add Backup Plan1.png

Assigning the backup plan to a VPS

After creating the backup plan you have to assign it to a VPS. You can assign a backup plan to individual VPSes or to the VPS plans.


Assign to Individual VPS

To assign a backup plan to a particular VPS first Edit the VPS:

Virtualizor Admin Panel -> Virtual Servers (Menu) -> List All -> Edit (Button)

Expand the Advanced Options block and select the previously created backup plan.

Add Backup Plan2.png

You can also select Same as VPS Plan if you want to assign the same backup plan that is assigned to the VPS plan.


Assign to the VPS Plan

To assign a backup plan to the VPS plan first Edit the VPS plan:

Virtualizor Admin Panel -> Plans (Menu) -> List Plans -> Edit (Button)

Expand the Advanced Options block and select the previously created backup plan.

Add Backup Plan3.png

You'll also need to select Same as VPS Plan on the Edit VPS page of all the VPS you want to include in this backup plan.

The Settings in detail

Disable

Check this to disable the backup plan. Disabling the backup plan will not run it from the cron and the endusers will not be able to backup/restore all the VPS assigned to this plan.

Backup Server

This is the name of the backup server to which the VPS backups will be uploaded. At least one backup server needs to be added before enabling VPS backups.

Directory

This is the directory where the VPS backups will be stored on the backup server. Please specify a valid existing directory on the server.


Backup Frequency

Hourly

VPS Backups2.png

This will initiate the backup process every amount of hours selected.

Daily

VPS Backups3.png

This will initiate the backup process every day, at the selected time.

Weekly

VPS Backups4.png

This will initiate the backup process every week on the selected day at the selected time.

Monthly

VPS Backups5.png

This will initiate the backup process every month on the selected date at the selected time.

Backup Rotation

This will set a rotation for the backups. For example, if the rotation is set to 2 then the 2 most recent backups of the VPS will be kept on the server, the rest will be deleted.

Enduser Backups

This will allow the endusers to initiate backups of their VPS at their will. You can set a monthly limit to the number of backups they can initiate with this option.

Enduser Restores

This will allow the endusers to initiate restores of their VPS at their will. You can set a monthly limit to the number of restores they can initiate with this option.

Process Priority

This will assign the priority of the backup process. The higher the priority the more CPU time it gets. A higher value means a low priority and a lower negative value means a high priority. If there are large containers on the node its recommended run it at the lowest priority i.e 19 .



Process I/O Priority

This will assign the priority of the backup process input/output. The higher the priority the more disk time it gets. There are two aspects of this:

Priority

Values between 1 to 7 can be selected. Its is recommended to use a medium value such as 4.

Class

Idle
The backup process will be get disk time only when no other program is requesting it. Recommended for long backups processes
Best Effort
Real Time
The backup process will be given high disk priority over other programs.


Disable Compression

Check this to disable compression for the backups. This will reduce CPU usage but increase IO usage of the backup process and will also increase the size of the VPS backups.


Troubleshooting/Logs

The log file for the backup process can be found at /var/virtualizor/log/backup/VPSID.log

The log file for the restore process can be found at /var/virtualizor/log/restore/VPSID.log

Note:- Backups are not supported on File Based Storage.

Starting immediate backup

You Will require to configure all the settings for UI first.

Then execute the below command from console :-

/usr/local/emps/bin/php /usr/local/virtualizor/scripts/vpsbackups_plan.php -b<backup-plan-id> [options]

Options:
    -f    Force backup even if backup plan is disabled