VestaCP is a open source webhosting control panel. It support FTP and SFTP backup out of the box, but with some patches can be adapted to backup to ObjSpace.

This is an experimental set of patches so please backup your system before making these changes. Delimiter is not responsible for dataloss or damage caused by using or following these instructions.

Patching VestaCP

StepActionCentos / RedhatDebian / UbuntuDescription
1Install S3CMDcd /etc/yum.repos.d
wget http://s3tools.org/repo/RHEL_6/s3tools.repo
yum -y install s3cmd
sudo wget -O- -q http://s3tools.org/repo/deb-all/stable/s3tools.key | sudo apt-key add -
sudo wget -O/etc/apt/sources.list.d/s3tools.list http://s3tools.org/repo/deb-all/stable/s3tools.list
sudo apt-get update && sudo apt-get -y install s3cmd

S3CMD is used to connect to ObjSpace
2Configure S3CMDcat > /root/.s3cfg <<EOF
[default]
access_key = YOURACCESSKEY
secret_key = YOURSECRETKEY
bucket_location = US
cloudfront_host = cloudfront.amazonaws.com
cloudfront_resource = /2010-07-15/distribution
default_mime_type = binary/octet-stream
delete_removed = False
dry_run = False
encoding = UTF-8
encrypt = False
follow_symlinks = False
force = False
get_continue = False
gpg_command = /usr/bin/gpg
gpg_decrypt = %(gpg_command)s -d --verbose --no-use-agent --batch --yes --passphrase-fd %(passphrase_fd)s -o %(output_file)s %(input_file)s
gpg_encrypt = %(gpg_command)s -c --verbose --no-use-agent --batch --yes --passphrase-fd %(passphrase_fd)s -o %(output_file)s %(input_file)s
gpg_passphrase =
guess_mime_type = True
host_base = obj.space
host_bucket = %(bucket)s.obj.space
human_readable_sizes = False
list_md5 = False
log_target_prefix =
preserve_attrs = True
progress_meter = True
proxy_host =
proxy_port = 0
recursive = False
recv_chunk = 4096
reduced_redundancy = False
send_chunk = 4096
simpledb_host = sdb.amazonaws.com
skip_existing = False
socket_timeout = 10
urlencoding_mode = normal
use_https = False
verbosity = WARNING
EOF

YOURACCESSKEY and YOURSECRETKEY are shown on the welcome email.

If your Secret Key has an escaped / ie \/ (backslash then forward slash) then remove the backslash so just the forward slash is copied into the config.

3Test S3CMDs3cmd ls

This will show a list of all buckets currently in your ObjSpace account. If you have not created any yet then it will be empty.
The critical thing is to ensure that no error appears

4Change to VestaCP directory

cd /usr/local/vesta

 
5Download the patches

wget http://delimiter.obj.space/vestacp/vestacp-objspace-06aa3a92-dist.tar.gz

 
6Backup the system files

cp bin/v-backup-user bin/v-backup-user.ORIGINAL
cp web/templates/admin/edit_server.html web/templates/admin/edit_server.html.ORIGINAL

 
7Untar the patched filestar xvzf vestacp-objspace-06aa3a92-dist.tar.gz 

Configuring VestaCP

Login to VestaCP and go to Server -> Configuration. In there select Backup and make the following changes:

  1. Enter a bucket name, you can precreate a bucket or leave VestaCP to create it for you.
  2. AccessKey and SecretKey are not used here at this time, this is because VestaCP passes the data to the command openly which can be easily seen on a public system. You have to enter dummy values in here in order for VestaCP to process the backup file.
  3. Enter a directory (if required), this in case you want to have multiple servers backing up to the same bucket. You should not place a slash in the directory name.
  4. Click Save

 

Go back to the command line and verify that the Objspace configuration file now been generated by VestaCP:

cat /usr/local/vesta/conf/objspace.backup.conf

You should see your bucket name and directory in the HOST and BPATH variables respectively.

Testing Backup

Time to test the backup works, you'll need to choose a user to test with then run:

/usr/local/vesta/bin/v-backup-user [username]

The backup will run and you specifically want to watch out for errors. For example 'ERROR: S3 error: 403 (AccessDenied)' or 'ERROR: S3 error: 409 (BucketAlreadyExists)'. If you get these errors then ensure you have a unique bucket name and that your accesskey and secretkey are correctly entered in VestaCP.

A successful run will look like this:

-- SUMMARY --
2016-01-05 02:02:37 Remote: objspace://mybucket123/mysubdirectory/markturner.2016-01-05.tar
2016-01-05 02:02:37 Checking ObjSpace connection
2016-01-05 02:02:37 Creating bucket (if necessary)
2016-01-05 02:02:38 Checking retention
2016-01-05 02:02:38 Current Backups = 1 Max Backups = 1
2016-01-05 02:02:38 Creating tarballs then uploading backups
'markturner.2016-01-05.tar' -> 's3://mybucket123/mysubdirectory/markturner.2016-01-05.tar'  [1 of 1]
 51200 of 51200   100% in    0s     5.17 MB/s  done
'markturner.2016-01-05.tar' -> 's3://mybucket123/mysubdirectory/markturner.2016-01-05.tar'  [1 of 1]
 51200 of 51200   100% in    0s   270.20 kB/s  done
2016-01-05 02:02:38 Size: 1 Mb
2016-01-05 02:02:38 Runtime: 1 minute

 

Summary

This is provided as-is, you need to test that the patches provided successfully backup your data and that you can restore it using the regular VestaCP tools.

If you have any issues using ObjSpace then please open a support ticket.