1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.4 How to do local backup of huge forum

Discussion in 'XenForo Questions and Support' started by NeoCHI, Aug 11, 2014.

  1. NeoCHI

    NeoCHI Active Member

    So currently my database is over 4g and when I try to back it up locally using cpanel it takes waaaay to long to download. How can I do a backup of my site outside of my server?

    I've thought about using a free cloud storage but I'm not sure if that transfer would be faster either...
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    You should be using SSH to dump a databse of that size.

    Code:
    mysqldump -u<user> -p --single-transaction --skip-lock-tables <db_name> > /path/to/backup/<db_name>_$(date +%d.%m.%y).sql
     
  3. shawn

    shawn Well-Known Member

    That sounds like a job better suited to something like Percona's Xtrabackup. Use that to create the backup with no downtime, then copy the backup and any related partial/delta backups to a remote location.
     
  4. NeoCHI

    NeoCHI Active Member

    So if I ssh into my server and use mysqldump it'll save it to my local computer?
     
  5. Brogan

    Brogan XenForo Moderator Staff Member

    No, it will just back it up to your server.

    You would then need to tar it and download it.
     
  6. NeoCHI

    NeoCHI Active Member

    So that's where the issue starts...I've tried something similar with my WHM's auto scheduled backup. Those files are HUGE (couple gigs) and when I try to scp it, it just takes waaay too long...
     
  7. AndyB

    AndyB Well-Known Member

    How many posts does your forum have?
     
  8. Brogan

    Brogan XenForo Moderator Staff Member

    If you use standard MySQL search (you don't have ES installed), dump it without the search_index table then rebuild the search index on your localhost.
     
  9. NeoCHI

    NeoCHI Active Member

    Over 1 million.
     
  10. AndyB

    AndyB Well-Known Member

    I have 1.3 million posts and my database backup is 850MB.

    One thing I suggest is to purchase Enhanced Search so you can empty your xf_search_index, that will reduce the size of your backup considerably. Transferring 850MB from my server to my house takes only a few minutes. However I have two hard disks in my server and I set up a Cron to copy the backup to the spare server every day.
     
  11. MattW

    MattW Well-Known Member

    If it's slow to your house to take an offsite backup, then I'd recommend looking into an offsite solution like Backupsy.
     
  12. NeoCHI

    NeoCHI Active Member

    This maybe the solution I need. I think it's slow mainly cause my server is located in the US and I'm now located in China.
     
  13. AndyB

    AndyB Well-Known Member

    You can also ask your web hosting company how much it would cost a month for them to provide a backup storage disk that you can copy to.
     

Share This Page