Jump to content

Best Process for Backing Up Site


aw.be
 Share

Recommended Posts

Hello. I moved from WP to ProcessWire recently and am busy trying to figure out how to do things in PW, such as backing up a site.

For my WP clients, I've always used an extensive, easy to use premium plugin, not depending on the host (hostgator or bluehost) to keep everything up to date. So my question is, what is the accepted best way to back up a PW site to make sure that the whole thing can be retrieved and reinstalled in case something goes horribly wrong?

Thank you.

Aaron

  • Like 2
Link to comment
Share on other sites

I don't think it's a good idea to give them access to the database...

There is another nice solution. You can use the http://modules.proce...export-profile/ for backing up the site folder and the database at the same time. And you can do it with one click through the admin. The problem is that, if there is already a backed up folder on the server, the module tells you to delete it before continuing. So much for the one click solution :)

Ryan, couldn't this behavior be changed to something different?

EDIT:

Forget what I wrote, you can do it with one click :) Well, with some more clicks, but the module is not prepared for this purpose, and the instructions can become confusing for the clients.

Also, be aware that although this does backup the database, this folder will still be in the same computer and folder as the website is. Not a very effective backup if it's the only one.

  • Like 1
Link to comment
Share on other sites

I'm also interested in automated backups; i found this on Codecanyon and will probably purchase/try it for use with some PW sites..

http://codecanyon.ne...or=stormbreaker

Update: I have purchased this and installed it; it works very well; I was able to backup my processwire site and database with 1 click, and then setup a cron job to back it up once a week; the script saves your settings in a json file (so no database); I'm having it save the archives to a remote ftp, but it also supports local and dropbox backups.

Update 2: I just took a look at stillmovingdesign's suggestion, and the cpanel backup looks great...i like that the files are not stored in the web root;

  • Like 2
Link to comment
Share on other sites

Regarding Process Export Profile diogo mentioned above, does anyone have experience about how well it works with large sites? I myself have seen that it works well with your typical site installation, but what if there are (at least) multiple gigabytes of data (assets) etc?

Link to comment
Share on other sites

Regarding Process Export Profile diogo mentioned above, does anyone have experience about how well it works with large sites? I myself have seen that it works well with your typical site installation, but what if there are (at least) multiple gigabytes of data (assets) etc?

Probably not ideal for really large sites as it clones the /site/assets/files/ directory in creating the profile (which may double the size of disk space used by your site, temporarily). I could add an option to the profile exporter that justs instructs you which directories to download into your profile, rather than copying them. That would make it more useful for large exports. But the profile exporter was originally meant for doing things like exporting the Blog Profile or migrating a new site, as opposed to functioning as a dedicated backup tool.

Link to comment
Share on other sites

If you're running on a linux box how about using one of the many dedicated tools for backup. Here's an example that uses rdiff-backup on a user's home directory.

(This addresses file based backup needs only, not really thought about the MySQL side of things but perhaps the percona toolkit includes a non-blocking backup script)

Edited by netcarver
Link to comment
Share on other sites

I've used this script, built from stuff I learned here to back up sites in the past. It will only work on Linux hosting though.

To use it, create a folder above your public_html folder called "backups". In this create two folders called "site" and "db". It must be above the public_html folder else you will end up backing up your backups and you will soon run out of disk space that way ;)

Now you need to open the attached file and change the path near the top to the path to your backups folder.

Next, scroll down to line 41 and enter your site's root username and password (or a database users that you have created that can read all relevant databases for your site).

That's it really - upload it into public_html and call it via a web browser to test it, but it should backup the entire contents of public_html and all databases, plus as a special bonus your mail folder, which on this type of hosting means that even if the whole server bursts into flames you can just re-create the mailboxes, put that folder back and the mail is back too :)

Since it uses system commands to run the backups it won't work on restricted hosting, but the easiest way is to follow the above instructions and if it creates files in your /home/yoursite/backups/site and /db folders that have a filesize greater than 0kb then it will work on your hosting. Because it uses system commands rather than PHP to back up, it won't mater much what size your site is and is suitable for sites in the gigabyte range (all depends on your hardware of course).

The other thing to note is that it keeps 7 days of backups and cleans out anything older. You can change that by altering the $livecutoff variable to something other than 7.

This could use some improvement of course, but I use SyncBack Pro to download the backups each day to a local drive, and also periodically back these up to an external drive kept elsewhere (can you tell I've had trouble with hosting and hard drive failures before? ;)).

cronbackup.php

  • Like 4
Link to comment
Share on other sites

Next, scroll down to line 41 and enter your site's root username and password (or a database users that you have created that can read all relevant databases for your site).

You could also use a /home/[user]/.my.cnf file:

[client]
user=your_db_username
pass=your_db_pass

From there, you can just type 'mysql' and never have to use a password.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...