tags:

views:

62

answers:

4

Hi,

do you have any good suggestions how to backup remote php site and mysql, and upload it to another remote ftp? I do have shell access and it is linux system.

Kind of lame question when I post it like that, but I assume some script would have to be run on remote server with site, that would do this.

If you don't mind sharing your ideas, I would appreciate it.

Best, Zeljko

A: 

Have you tried rsync?

Take a look at the documentation and examples.

Otherwise, I think you should ask this on serverfault.

Carlos Lima
I wasn't aware of serverfault site :)
Zeljko Dakic
A: 

I second rsync but with a helping of mysqldump to dump your databases to a plain text file (assuming the DB is not too large).

Cymen
+2  A: 

Depends on the capabilities of your shell and the size of your site, but the first step could be very trivial: Use mysqldump and zip it together with your webpage. For uploading your archive you can maybe use wput or simply fall back to ftp which should be available on most shells.

merkuro
Seems like the way to go. I didn't know about wput which is probably what I need to simplify things. Thank you.
Zeljko Dakic
+1  A: 

Use mysqldump do dump the DB into a "data" directory within the site.
An alternative would be SELECT INTO OUTFILE if you already have the SQL scheme stored somewhere.

Use tar to pack up the website contents.

tar -xvf site.tar

Use FTP, SCP, SFTP, etc to transfer that to the new location, unpack, then depending on how the DB was dumped restore the DB and give it a whirl.

joebert