1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

Mirroring entire site

Discussion in 'Plesk for Linux - 8.x and Older' started by todd@, Aug 18, 2005.

  1. todd@

    todd@ Guest

    I need an expert to tell me if there is a simple way to mirror my entire site to a local server. It would consist of the site itself and the backend MySQL database as well.

    Is there a tool or script I can use?

    After doing the initial replication I would just need to do incremental backups of the database on a daily basis. Is there an efficient way to do that as well?

    Thanks for an help or suggestions you can offer.

  2. Dragons Master

    Dragons Master Guest

    Big move then cronjob

    Heya Mate,

    I don't know what system you're running but anyways the easiest way is first to move everything (wget), move the databases using mysqldump and mysql (I'm assuming u have shell access).

    Now the rest is dependant on how your system is built - the good way is all dynamic using databases - which in that case u can just have a primary key to each table, and run a daily cronjob on your mirror that checks your original server's primary keys and compares it to it's own - if there's s change just make a simple script on the other server that accepts a number and table name and returns all records from that table with a higher id (assuming that's the primary key).

    You can make that script just printout the sql query to insert it to your local table line by line - the script on the mirror will run the php command file on that script, and just run foreach and mysql_query each of the lines.. hope you understand and see what I'm saying..

    Hope it helps,
    - Ben
  3. phatPhrog

    phatPhrog Guest


    How about a link to some good documentation on what you just said. :p

    We are increasing our hosting to 4 servers and would like to set some of our sites up to run ns1 from one server ns2 from another to help keep downtime (if ever) to the barest minimum.

    We also have some database driven apps we'd like to run this way.

    Thought I'd stop by here first to see if there was a way.

  4. Who-m3

    Who-m3 Guest

    Dump the database (to restore locally), tar/gz the files and download them, boom, you're done.

    EDIT: Oh yeah, don't forget to set up the local server to utilize the information. However, I'd highly discourage doing this for a public mirror. Perhaps a good idea for something to test & break...