How to Make Backups on VPS Without WHM/Cpanel?

Status
Not open for further replies.

desibreaker

Banned
Banned
494
2009
5
0
hello everybody,
Well, recently i have bought a VPS and I got a trial WHM/CPanel with it and i have made the necessary arrangement to shift all my websites on it and i have created their accounts with the trial whm... but now in less than two weeks the trial whm/cpanel will be expired and thus ordering a whm/cpanel addon and he vps will cost me a total of about $40 each month...:facepalm:
and my budget does not permit me so :'(

thus I'm searching a solution to make backups without using WHm/cPanel but couldn't find one that i could understand properly as i'm a newbie in this field :P.

so can anybody help me out?
 
9 comments
cpanel

without re-installation you can not install a new Control panel.

more over Kloxo is great , give it a try.
 
Depends on what you want to backup? Dump the databases to a directory which can't be accessed via http, and tarball it with any other configs etc, gzip it, download.

Code:
tar -cf server_backup.tar /home/directoryname
gzip server_backup.tar
Download the .tar.gz file to your PC via FTP or another method like rsync, then delete it from the server.

For example, if I had a site in /home/mysite/public_html/... I could dump the database in that /home/mysite, and tarball it all at once.

Code:
mysqldump -u username -p databasename > /home/mysite/mysqlbackup
cd /home
tar -cf backup.tar mysite
gzip backup.tar
Backup will be at /home/backup.tar.gz to check it's size, ls -alh /home/backup.tar.gz
 
ok E, but here you only explained how to make backup for only a database? but if i want to make a full backup of the site ( the directory itself) is it possible?
 
Sometimes there is a need to backup a CPanel account without logging into the endusers CPanel yourself. In those situations the account can also be backed up via SSH. Every CPanel server comes with scripts that can be executed via SSH. In this case we will use the script: pkgacct
from the /scripts folder on your server.



1. Log into your server by using SSH

* Change to the root user

Code:
 su – root
2. Change directories to the script directory by executing the following command:
Code:
cd /scripts
3. Execute the CPanel script for the account backup:

Code:
  ./pkgacct username
(replace the username with the actual acount username that you are going to backup)

The screen output will look similar to this:
Copying domain Config…Done
Copying Mail files….Done
Copying proftpd file….Done
Copying www logs…Done
Grabbing mysql dbs…Done
Grabbing mysql privs…Done
Copying mailman lists….Done
Copying mailman archives….Done
Copying homedir….Done

4. The backup file will be placed in the users home directory.
You can now access the file and copy or move it to your backup drive or download it via ftp.


How to restore a Domain Account via SSH
1. Upload or copy the backup file (Example File Name: cpmove-joeuser.tar.gz) to the domain account Home directory via FTP.

2. Log into your server by using SSH
* Change to the root user
Code:
 su – root


3. Change directories to the script directory by executing the following command:
Code:
cd /scripts
4. Execute the appropriate CPanel script for the account restore:
Code:
  /scripts/restorepkg username
(replace username with the domain account username)


(make sure that the file name matches the necessary naming convention – follow the naming scheme seen in our example)
This will restore the domain account from the backup, as well as it will create the CPanel account. We have not tried to do a restore on top of an existing CPanel account yet, but we have heard that this should work just fine. Please test accordingly.



Trasfer Backup to Other server

Code:
scp cpmove-user.tar.gz root@newserverip:/home
(replace username with the domain account username)

now root Login new server via putty and run this command

Code:
  /scripts/restorepkg username
(replace username with the domain account username)

i hope this help you
 
Last edited:
Status
Not open for further replies.
Back
Top