Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Replicate database to another account automatically?

Discussion in 'Database Discussion' started by David Mason, May 11, 2019.

  1. David Mason

    David Mason Registered

    Joined:
    May 11, 2019
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    North wales
    cPanel Access Level:
    Root Administrator
    Hi

    I have someone who wants to have a direct copy of his web sites database on to another server every hour - its not a big database its about 30mb.

    They cant afford downtime - so we decided to manually once a day download the data from server 1 and upload it to server 2 via myphpadmin.

    Is there away to automate this kind of thing with cpanel or just in general?

    Thank You
    Dave
     
  2. GOT

    GOT Get Proactive! PartnerNOC

    Joined:
    Apr 8, 2003
    Messages:
    1,451
    Likes Received:
    178
    Trophy Points:
    193
    Location:
    Chesapeake, VA
    cPanel Access Level:
    DataCenter Provider
    You could bash script it. Set up a cron on the source server to dump the database to a file. Then on the destination server you set up a cron to copy that SQL file over and then use the mysql command to restore that database.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. GOT

    GOT Get Proactive! PartnerNOC

    Joined:
    Apr 8, 2003
    Messages:
    1,451
    Likes Received:
    178
    Trophy Points:
    193
    Location:
    Chesapeake, VA
    cPanel Access Level:
    DataCenter Provider
    You could also set up mysql replication but that gets tricky if the destination server is hosting other live databases.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. David Mason

    David Mason Registered

    Joined:
    May 11, 2019
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    North wales
    cPanel Access Level:
    Root Administrator
    Hi

    Thanks for the quick reply. I will have a look in to the script option.
     
  5. cPanelLauren

    cPanelLauren Forums Analyst II Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    6,124
    Likes Received:
    473
    Trophy Points:
    233
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    There isn't anything built in to cPanel will perform this function but the script idea that @GOT suggested may be the way to go albeit depending on the size of the database could be resource intensive
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice