Page 1 of 1

Is there something like a mirror site?

Posted: Mon Jul 23, 2007 3:19 pm
by legend986
I have a moderately big site with around 50000 posts. As I live in a country where the internet access is not so fast, I wanted to know if I could create a mirror site of my site, so that whenever my original site is updates, the changes are synced into the mirror site... Is there anything like that?

Or atleast, its ok if its able to copy my sql database to the other site without asking me to actually backup the site every now and then.... Are these possible?

Posted: Mon Jul 23, 2007 3:25 pm
by superdezign
You'd either have to pay a host to do it for you, or purchase another domain and program the updates yourself, as far as I'm aware.

Posted: Tue Jul 24, 2007 2:56 am
by legend986
Oh thanks... What do mean I should program it myself? Program a cron job u mean?

Posted: Tue Jul 24, 2007 6:40 am
by feyd
Yes, it's possible. Look into replication of the database. It's typically the most efficient means of duplicating the site. Otherwise you will need to send a spider over the site each time you want to update the copy, which will be more time consuming, generally.

Do not duplicate your threads please.

Posted: Tue Jul 24, 2007 7:10 am
by legend986
I'm really sorry about the duplicate thread. I thought it was somehow related to scripting. It won't happen again.

Anyways, coming to replication of databases, I have a doubt. My host doesn't give me anything like the /etc/mysql/my.cnf discussed in this article:

Code: Select all

http://www.howtoforge.com/mysql_database_replication
There is an etc directory but there's nothing similar to what has been discussed. So, is it possible to carry out these things through the cPanel or rather more specifically the PHPMyAdmin? Or is there a third party script that can achieve this?

Posted: Tue Jul 24, 2007 10:58 am
by Begby
There is no script to achieve this. To mirror the database you will need to follow the directions for replication on both servers. I strongly suggest you play with this at home on some test PCs and understand what you are doing. The my.cnf file could be in a subdirectory within /etc, or it could be named something else. Or it could be hidden from you. Talk to your hosting provider.

To mirror your site, like your php files and all of that, rsync is not a bad way to go. This will also catch if your site accepts uploaded files or anything. Rsync will duplicate all of the site files over to the other server.

FYI, replication is typically one way with mysql. The backup site will be readonly. There are ways to fudge around this, for instance by setting primary keys on one server to be even and then setting them to be odd on the other, then setting the servers to replicate to each other. You will however need to make sure your site is coded to handle this kind of thing.