Howdy, Stranger!

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


WordPress question: about backup
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.

WordPress question: about backup

Hi,

For wordpress backup like post and settings need save database too? Or its work only from files? So when create a post that need use database? So for save not enought wp files?

Comments

  • AmitzAmitz Member
    edited November 2015

    Right. You need to backup the database too.
    There are even plugins for that. Here is (just) an example:
    https://de.wordpress.org/plugins/wp-db-backup/

    Thanked by 2miklos sin
  • mysqldump the database
    tar the folder

    done

    Thanked by 2miklos sin
  • I use automysqlbackup (VERY easy to install) which backups all my Wordpress databases daily, weekly, and monthly and saves them to a folder and then I have that folder rsynced over to my backup server.

    apt-get install automysqlbackup
    nano /etc/default/automysqlbackup (and choose where you want the databases saved to, default is /var/lib/automysqlbackup, and put your email address where you want any notices sent to)

    or manually backup using mysqldump:

    mysqldump -u root -p database_name > dumpfilename.sql

    and to restore it:

    mysql -u root -p database_name < dumpfilename.sql

    and to dump ALL databases:

    mysqldump -u root -p --all-databases > all-database.sql

    Thanked by 2miklos Amitz
  • martip07martip07 Member
    edited November 2015

    Plugins are good, but what is doesn't work.

    I would go for the old school style with cronjobs. This onyl works if you have access to the server.
    Is almost the same @4n0nx wrote.

    1. tar -czf wp-$(date +\%Y-\%m-\%d).tar.gz /my/wordpress/location
    • Test it and after that add it in a cron, the time is up to you, example once a day, once a week, etc.
    1. A script will do the job.

    !#!/bin/bash

    date=$(date +%Y%m%d%H%M)

    mysqldump -u "user" -h "hostname" -p "password" > wpdb.$date.sql

    • Add it in a cronjob and thats all :)
    Thanked by 2miklos sin
  • Don't use backup plugins, or if you do test them lots!

    I've always had issues restoring blogs that use backup plugins, and they never get everything right.

    You can never beat a mysql dump and zip of httpd directory...

  • I never do backup, you can always blame the provider trololol

    Thanked by 2sin GM2015
  • I have cron backup all files and database to another vps. I tried some/most wordpress backup plugins, most of them work ok (ftp), but they are somewhat hard to restore later because the way they backup files.

    create a script yourself then run cron daily or whatever, much better than plugins.

Sign In or Register to comment.