separate cloned server

14 posts / 0 new
Last post
#1 Wed, 06/17/2009 - 18:31
Tdah

separate cloned server

I’m planning to set up a separate cloned server and was wondering the best way to accomplish this, call it a fully functional backup server to the original running the exact same everything. Is there an easy way to do this without setting it up again manually?

Then I want to clone the user’s websites etc. when one server goes down for whatever reason this one takes over.

Should I use backups, clustering...what’s the best practice for this sort of thing using the webmin/virtualmin tools? Or is it possible

I was curious so I just jumped in and tried a few things, I really didn’t think this would work but good news it did I have a Debian 5 system and for some reason a Centos 5 system already set up with virtualmin , I backed up the Debian with everything; all domains and files download from my browser, because of no network set between the two; 475MB of info. Imported it to my Centos box kept the Centos ip then changed my firewall to point to the Centos and worked without any modifications, all websites databases and email all worked, “Very good job guys” , now I just need to set up a cron job to do this for me and I’ll be on my way

Thu, 06/18/2009 - 20:35
andreychek

Yeah, what you did would work just fine.

In fact, you could use the command line backup tools to generate the backups, send them to the remote server, and have cron perform an import of the backup files each night.

How exactly you setup your backup server depends a bit on your budget, and how important not having any downtime whatsoever is.

A pretty cool high availability setup was recently documented here:

"Virtualmin High Availability Domain Hosting with DRBD & Heartbeat" http://safestream.net/blog/?page_id=12

That's a great setup, but many folks really don't need that level of reliability.

For those that do, the above should work great. It's an involved setup process, but the above post goes into a lot of detail.

However, if copying over the backup files once a day or so is good enough, that's nice and easy to setup :-) -Eric

Thu, 06/18/2009 - 21:35 (Reply to #2)
Tdah

Thank you! Personally I like a detailed plan, there’s too many vague “how to” plans out on the net

Sat, 06/20/2009 - 17:27 (Reply to #3)
Tdah

So how to schedule a restore with the backup scheduler? Or with a scheduled cron job

Example of my situation, I’m backing up to a local folder called ’ /backup’, I have a backup server already set up for a 2003 server with backup software installed and that’s all this pc does is backup and store files,

I share the backup folder using samba on both virtualmin machines, my backup pc copies the backup file from server1 to its self and over to server 2 ‘/backup’ , now the second server needs to schedule a restore backup from that backup folder every night

I don't see the link in virtualmin

Sat, 06/20/2009 - 19:53 (Reply to #4)
andreychek

I would use the command line tools from within cron.

If you run:

virtualmin restore-domain

You'll see a list of possible command line options:

virtualmin restore-domain --source file
                         [--test]
                         [--domain name] | [--all-domains]
                         [--feature name] | [--all-features]
                         [--except-feature name]
                         [--reuid]
                         [--fix]
                         [--option feature name value]
                         [--all-virtualmin] | [--virtualmin config]
                         [--only-features]
                         [--shared-ip address | --ip address | --allocate-ip]
                         [--only-missing | --only-existing]
 
Multiple domains may be specified with multiple --domain parameters.
Features must be specified using their short names, like web and dns.
 
The source can be one of :
 - A local file, like /backup/yourdomain.com.tgz
 - An FTP destination, like ftp://login:pass@server/backup/yourdomain.com.tgz
 - An SSH destination, like ssh://login:pass@server/backup/yourdomain.com.tgz
 - An S3 bucket, like s3://accesskey:secretkey@bucket
Sun, 06/21/2009 - 13:14 (Reply to #5)
Tdah

I played around with it an got the right command line finaly

virtualmin restore-domain --source /backup/backup.tgz --all-domains --all-features

to backup it's

virtualmin backup-domain --dest /backup/backup.tgz --all-domains --all-features

thanks for the help :-)

now how to get read write permissions on the backup file, is there a switch for the virtualmin backup-domain line?

Sun, 06/21/2009 - 14:44 (Reply to #6)
andreychek

I think it's generally assumed that only root would be dealing with the backups -- if you're trying to use a user other than root, you might need to run a chown and/or chmod from the command line script to get the permissions and ownerships you're interested in. -Eric

Sun, 06/21/2009 - 15:52 (Reply to #7)
Tdah

Thanks again, I have it set up now through the cron command line, also set up custom commands for manual execution

Thu, 07/02/2009 - 16:38
jdamron

Ok i see the comand line but what if you dont want to backup to one time... what if you wanted to backup each domain as a file.. i forget what the comand if for that just like if you backup from the webpage becasue i have a few acounts that Error out on the webpage becasue they are to big.... so it times out when it goes and tars up the file...

Fri, 08/07/2009 - 14:45
rrhill

OK I like the idea of using the Virtualmin commands to clone the sites and settings, copy that to another system and restore on a nightly basis ... do these commands also backup associated databases, installed tolls/scripts (like WrodPress), user names/settings? Is there any reason to also do a webmin settings backup as well?

My thought is to do the virtualmin backup-domain once each night to local /backup directory, rsync the backup directory to the remote system, then use the SSH option in virtualmin restore-domain from the primary vmin server to update the backup system. What I would like to also do is a periodic rsync of data between the two to keep the backup closer to current than 24 hrs. What directories/files on the vmin primary need to be rsync'ed to the backup to accomplish this?

Fri, 08/07/2009 - 14:51
andreychek

Yeah, the Virtualmin commands backup everything related to the Virtual Server by default (though of course, always test your backups :-)

You can also configure the backup to backup Virtualmin settings, allowing you to import all your Virtualmin settings on the remote server.

At that point, the only thing you don't have is any customizations you're making outside of Virtualmin, such as customizations to config files in /etc/, and any packages you've installed.

-Eric

Wed, 08/12/2009 - 12:06
rrhill

Trying to finalize my backup strategy this week so I can get vmin rolled out to some test clients. Read the legacy(?) doc on Backup and Restore:

https://www.virtualmin.com/documentation/id,backups_and_restoration

Along with this thread. SO here's the plan so far with questions:

Two servers, each with same OS. Each with two drives using RAID1 mirroring. One is the primary, one the backup. VMIN on both.

Run daily backups and a weekly full backup of all virtual servers to local /backup directory on primary. (might do a daily full backups instead of incremental) Schedule backups to age out after X days. Should all of the backups include the vmin settings or should the settings be backed up separately from the virtual server backups? The backup doc example also does file system backups via webmin. I have three partitions, /boot/, swap and /. I assume given the two systems are identical, just backing up / would be sufficient(?)

Rsync the /backup directory to the backup server ... syncing only changed files.

Restore the vmin environment on the backup server from last full or incremental (depending). The primary and backup servers have different IP/hostnames, of course. How will this impact the restore vmin environment? Do I just need to change the hostname and IP on the backup to make it the primary (in case of failure)... or?

The webmin file system backup would not be used except if an issue arose and some custom settings were needed. I intend to use just the vmin GUI to do my system management so I don't see the webmin filesystem backup(s) as anything but a just-in-case step.

Wed, 08/12/2009 - 13:56 (Reply to #12)
rrhill

Guess its a risk/benefit issue. Changing my mind. Just will backup the primary. Webmin backup of /. Vmin back with settings. Rsync backup files to off site storage drive. If the primary fails. Will reinstall the OS, restore the / filesystem from backup. Install vmin backups and should be good to go. Now I juts need to determine if I want the RAID1 the primary or not ...

Sat, 11/29/2014 - 05:36
nandt

hello i am trying to do a backup from one server to another and restore after the backup is done with no success.

what i am doing on command line is /usr/sbin/virtualmin restore-domain --source /home/fullbackup/mydomain.gr.tar.gz --all-domains --all-features and on the backup i select one file per server. i have try many variations with no success i suppose i am missing something or i am using a wrong syntax. can you please explain the a little bit how to use the syntax? on the above discussion i have see --source and ---dest what is the difference . as i want to run the command after the backup is done should i suppose to use the following ( --source ) as described on my above line? and is there a different syntax if i choose one file per server or each domain

should the source file as its local after the backup is done to declare with the following syntax as descibed bellow?

I would really appretiated some help upon that feature or something more detailed as i am not familiar with the procedure and i am not sure how to use the below [--test] e.t.c parenthesis for the restore to completed.

what i receive is .. Missing or invalid restore file

Restores a Virtualmin backup, for the domains and features specified on the command line.

virtualmin restore-domain --source file [--test] [--domain name] | [--all-domains] [--feature name] | [--all-features] [--except-feature name] [--reuid | --no-reuid] [--fix] [--option "feature name value"] [--all-virtualmin] | [--virtualmin config] [--only-features] [--shared-ip address | --ip address | --allocate-ip | --original-ip] [--default-ip6 | --shared-ip6 address | --ip6 address | --allocate-ip6 | --original-ip6] [--only-missing | --only-existing] [--skip-warnings] [--continue-on-error] [--delete-existing]

Multiple domains may be specified with multiple --domain parameters. Features must be specified using their short names, like web and dns.

The source can be one of : - A local file, like /backup/yourdomain.com.tgz - An FTP destination, like ftp://login:pass@server/backup/yourdomain.com.tgz - An SSH destination, like ssh://login:pass@server/backup/yourdomain.com.tgz - An S3 bucket, like s3://accesskey:secretkey@bucket - A Rackspace container, like rs://user:apikey@container

Topic locked