Suggestions for backing up php site and mysql db

≯℡__Kan透↙ 提交于 2019-12-02 05:29:53

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.

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.

Have you tried rsync?

Take a look at the documentation and examples.

Otherwise, I think you should ask this on serverfault.

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).

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!