Suggestions for backing up php site and mysql db

Do you have any good recommendations on backing up a remote php and mysql site, as well as uploading it to another remote ftp? I have shell access and this is a Linux system.

Some kind of lame question when I post it like this, but I assume some scripts must be running on a remote server with a website in order to do this.

If you do not mind sharing your ideas, I would appreciate it.

Best, Zelko [/ p>

+1
source share
4 answers

Depending on the capabilities of your shell and the size of your site, but the first step can be very trivial: use mysqldump and write it along with your web page. To download your archive, you can use wput or just go back to ftp , which should be available for most shells.

+2
source

Use mysqldump to dump DB into the "data" directory on the site.
An alternative would be SELECT INTO OUTFILE if you already have some kind of SQL schema.

Use tar to pack the contents of the website.

tar -xvf site.tar 

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

+2
source

Have you tried rsync ?

Take a look at the documentation and examples.

Otherwise, I think you should ask about it on serverfault .

0
source

I am the second rsync, but helping mysqldump delete your databases in a plain text file (assuming the DB is not too big).

0
source

Source: https://habr.com/ru/post/1334111/


All Articles