Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


website on vps backup method
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

website on vps backup method

i want to build website with wordpress on vps,could you give me some tutorial that works well on how to back up the websites?i have research on internet for some time,but the scripts do not work well.
thank you.

Comments

  • tsantentsanten Member
    edited April 2014

    Install VestaCp and you will have all you ask there.

  • ScionScion Member

    A wordpress site is composed of two main parts: the website files and the database. Backing up the website files is easy. Something like this would do the trick:

    tar cvzf [filename].tar.gz [path to website files]
    

    Then for the database, there's a tool called mysqldump (or pgdump if you use PostgreSQL instead of MySQL):

    mysqldump --opt -u [uname] -p[pass] [dbname] > [backupfile.sql]
    

    Then just copy your .tar.gz and .sql file out to a safe place. When you need to restore it, you can un-tar your backup and execute the SQL file to restore both the website and the database.

    Having said all that, I use rsync to do incremental nightly backups instead of the above method because incremental backups tend to be much smaller and it was easier to automate. The command I use goes a little something like this:

    rsync -aAvz --numeric-ids --delete /* /backup/hostname --exclude={/backup/*,/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/mnt/*,/media/*,/lost+found,/home/*/.gvfs}
    

    That makes a copy of the entire main disk (minus the stuff that is excluded) and stuffs it in a directory that's mounted on a different disk. After doing it the first time, it only updates whatever changed since the last time it ran. You can also get it to rsync over ssh to do a remote backup without much effort.

    Thanked by 1wlcy001
  • Or use docker and make a backup for all your container

  • If you only want to back up the Wordpress site itself, I just use a plugin called UpdraftPlus which backs up both the site and the database files.

  • @nekrox said:
    Or use docker and make a backup for all your container

    what is docker, is that free?

  • @hellogoodbye said:
    If you only want to back up the Wordpress site itself, I just use a plugin called UpdraftPlus which backs up both the site and the database files.

    thanks ,i will have a try

Sign In or Register to comment.