Backup/Restore & Mirror/Migration, Work in progress.

  • Hi,


    Just following up on where I got to with my backup/restore tasks related to the command line tools posted at http://forum.i-mscp.net/Thread-Command-line-tools-for-i-mscp by aseques, as others were interested.


    I don't host mail currently, so I have not made anything for that, however my "solution" works with the i-mscp backup files, so perhaps mail will be included with those in future? who knows!


    The goals I have are as follows (you don't have to use all of them):


    - create/remove/modify accounts on multiple servers at the same time (aseques's tool + multiple servers at once)
    - keep an optional number of backups at varying frequencies (this script)
    - import/export customer data from one server to another regularly and manually (this script - 99% done)
    - have each server run failure detection checks for websites and communicate via encrypted output (works but using ExpressionEngine..)
    - if more than *threshold* servers detect the 1st server in priority list is working and site is currently not pointing there, redirect via DNS, otherwise run same check on next server. Each server does this independently. (works but using EE again, and uses external DNS service)


    This script:
    Uses s3cmd to backup/restore the daily backup files at chosen intervals (cron) to Amazons S3 (you can apt-get this tool) with IAM credentials for each server. Each server has write access to a bucket, and read access to all other server buckets. In my script you can choose backup|restore, daily|weekly|monthly, domain.tld|all, optional bucketname (default stored in script). It stores the files in s3://bucketname/domain.tld/frequency, and cleans up old files. You can easily change the frequencies and rename those options. Please feel free to give feedback on this, and to replace s3cmd with your chosen tool/backup location. Keep in mind I'm a noob at bash scripts.


    This works great for backup/restore/mirror! The downside to this is I still have to manually trigger the actual restore from those files via the admin panel on each backup/mirror server. Perhaps I can set some database flag for each domain and run some existing script to take care of the restores for me???


    I will provide the tools to perform the command line stuff across multiple servers when they are ready.


    I am probably just going to use a CodeIgniter interface to replace my EE one, which I already use for a working DNS based failure detection system to redirect websites to mirror servers. Using this same system I can communicate tasks for each server to perform, and potentially ones for only certain servers. I realise how similar this process is to future multi-server development...