Welcome to Centmin Mod Community
Register Now

A ¨Possible¨ guide for Rsync on centminmod with wordpress websites

Discussion in 'Install & Upgrades or Pre-Install Questions' started by Venucci, Oct 29, 2019.

  1. Venucci

    Venucci Member

    63
    8
    8
    Sep 25, 2018
    Ratings:
    +8
    Local Time:
    8:32 PM
    currentyl
    10
    Please fill in any relevant information that applies to you:
    • CentOS Version: i.e. CentOS 7 64bit ?
    • Centmin Mod Version Installed: i.e. 123.09beta01
    • Nginx Version Installed: i.e. 1.17.5
    • PHP Version Installed: i.e. 7.3.11
    • MariaDB MySQL Version Installed: i.e. 10.3.18
    • When was last time updated Centmin Mod code base ? : 2days ago
    • Persistent Config: Do you have any persistent config file options set in /etc/centminmod/custom_config.inc ? letsencrypt Y
    I wish to make a proper guide how to create a backup for centminmod+wordpress using rsync for a specific domain . I would need your help as well in order to solve any doubt or errors for my guide.

    What we need : 2 VPS a client and a backup

    1) Open a SSH and check for updates on both machines

    yum check-update

    2) Let s install the rsync on both machines

    yum install rsync

    3) Let s install the sshpass on both machines

    yum -y install ssh rsync


    4) We put pwd on the ssh
    pwd

    5) We put mkdir archivesclient
    mkdir archivesclient

    5) We create the script

    vim /path/script_rsync

    and we put this content in it


    #!/bin/bash
    #script for syncronization
    sshpass -p 'passServer' rsync --progress -av -delete -e ssh [email protected]:/path/server/ /path/client

    Passserver = password of the server
    192.168.1.66 = your IP
    path server = the origin of the files
    path client = the destination of the files
    6) We are giving it permissions

    chmod 777 script_rsync

    7) We must create the first conexion of both machines

    ssh [email protected]
    192.168.1.66 you must put your IP

    8) After that we must exit from the machine
    exit

    9) After that we activate the script

    ./script_rsync

    10) Cron activation

    $ crontab -e
    11) we put the hour of the daily back up example for 10PM


    0 22 * * * rsync -av --delete /Directory1/ /Directory2/
    12) after configuring press
    :wq
    13) @eva2000 should double check it if this fits on centminmod and make the corrections from any doubts/incorrect information about this guide to set a rsync on centminmod with wordpress website

    @eva2000 COuld be possible to make a domain backup if in the centminmod i have 2 or more wordpress websites ? What i must specify in order to do it ? Thanks hopefully this guide would be beneficial for all of us doing our backups .

    I am sorry if there is something wrong on the guide information . I have made all the best . Kind regards !
     
  2. eva2000

    eva2000 Administrator Staff Member

    42,078
    9,497
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,613
    Local Time:
    5:32 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    For moving site data there's 2 general guides where the principles & steps of backing up and moving data is the same just slightly different for
    1. Moving Centmin Mod site data to another Centmin Mod server
    2. Moving cPanel/WHM site data to Centmin Mod server
    Those guides move alot more than just the site(s) in question but config files etc. You can use your own best judgement as to the config files and whether you want to move them or just use the fresh server setup Centmin Mod config files as they get auto optimised for the server Centmin Mod initially installed on.

    If your old site isn't centmin mod or cpanel/whm based, then those guides won't be 100% applicable. But the general overview of what needs moving and where everything is structured in Centmin Mod LEMP environment is worth reading up on.

    Also official site configuration files page explains the Centmin Mod structure of where the important files are so you can decide on what to backup.

    Transferring data from one server to another is always the same. To backup data and transfer to new server. You can try some tips I posted and discussion at Restore from Backup Scenario - transfer to new server

    To read up more on rsync usage see
     
  3. eva2000

    eva2000 Administrator Staff Member

    42,078
    9,497
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,613
    Local Time:
    5:32 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    If you worried you mess up, just create a new test VPS and load/create a dummy site/database data and test migrating that to a 2nd test VPS until you're comfortable with the process.