stempy
Jr. Member

Posts: 48
|
 |
« on: Feb 10, 2006, 04:05 PM » |
|
Hi All,
Here is a module to backup your entire MODx based site (files & database) into one .zip file, for a single download.
Useful for backing up and moving from a staging server to production server.
Run it, click generate button, than download .zip file
* Multiple backups can be kept, just hit generate again. * Log data is not inserted into sql dump file to reduce sql bloat
I've tested it in a few different hosting environments (Linux, Windows XP) and it seems to work ok, however any feedback would be appreciated.
Installation is fairly straightforward.
1. Create a directory on your webserver to hold modx .zip archives (ie /home/username/_backup ) and set read/write permissions to 777 2. Unzip modbak directory under /assets/modules/ directory. --> /assets/modules/modbak 3. Edit /assets/modules/modbak/download.php, and set $modx_backup_dir to backup dir in new directory created in (1) 4. Create a new Module in MODx manager and copy contents of modbak.module.tpl into module code. 5. Now run module, click generate, if it works there should be a .zip link containing your modx site.
7 Mar 07 v0.9.4 - Fixed . in sitename, added settings.php file to simplify config 4 Mar 07 v0.9 - Added table_prefix, restructured code - archive and database filenames by default use sitename (ie mysite12-10-07.zip, mysite.sql) - memory and time limits are set as variables (however also dependent on php.ini host setup)
13 Feb 06 - Added theme look, tested some more, all database tables included, however log data is not inserted. 11 Feb 2006 - Updated MODx module(modbak05.zip) to backup entire modx site including the database tables (by default LOG tables are not included in backup).
Hope it comes in Handy.
Rob Stemp
|
|
|
« Last Edit: Mar 16, 2007, 06:11 PM by stempy »
|
Logged
|
|
|
|
rthrash
Foundation

Posts: 10,471
|
 |
« Reply #1 on: Feb 10, 2006, 04:10 PM » |
|
PLEASE post that up. 
|
|
|
|
|
Logged
|
MODx is a framework that allows web professionals to turn over sites to end-users for daily maintenance without worrying. Community participation and questions are encouraged, especially when you help us help you, read the wiki, and review snippet parameters – even if you have to look at the source. Searching the forums helps, too.
Ryan Thrash
MODx Co-Founder
Principal @ Collabpad
work productively.
work intelligently.
work together.
|
|
|
Kunal Kapoor
Full Member
  
Posts: 145
Effective, Functional, Standards Compliant
|
 |
« Reply #2 on: Feb 10, 2006, 05:19 PM » |
|
That sounds fantastic. Oooh, yes please!
|
|
|
|
|
Logged
|
|
|
|
garryn
Coding Team

Posts: 1,252
|
 |
« Reply #3 on: Feb 10, 2006, 08:39 PM » |
|
Hi stempy, Great module!  Just tested this on my live website and worked a treat. Cheers, Garry
|
|
|
|
|
Logged
|
|
|
|
sottwell
Documentation Team

Posts: 8,837
|
 |
« Reply #4 on: Feb 10, 2006, 11:21 PM » |
|
Might include an sql dump of the modx database aswell.
Just keep in mind that the logging tables can be a real killer if their data is dumped as well!
|
|
|
|
|
Logged
|
|
|
|
stempy
Jr. Member

Posts: 48
|
 |
« Reply #5 on: Feb 13, 2006, 02:56 AM » |
|
Just keep in mind that the logging tables can be a real killer if their data is dumped as well!
Ok, thank you for that, I have updated the module to include just the table structure for the logs.
|
|
|
|
|
Logged
|
|
|
|
xwisdom
Foundation

Posts: 1,732
|
 |
« Reply #6 on: Feb 13, 2006, 06:22 AM » |
|
Very nice module!  I'll have a look at it later to see if I can convert it into an installable package
|
|
|
|
|
Logged
|
|
|
|
en8scl
Jr. Member

Posts: 20
|
 |
« Reply #7 on: Feb 22, 2006, 04:22 PM » |
|
Hi
The Modbak module functions great but the interface doesn't render properly under IE6 (its fine in firefox) - see attached IE screen grab.
I have also added txt file of the source.
|
|
|
« Last Edit: Mar 19, 2006, 03:26 PM by en8scl »
|
Logged
|
|
|
|
stempy
Jr. Member

Posts: 48
|
 |
« Reply #8 on: Feb 22, 2006, 04:31 PM » |
|
The Modbak module functions great but the interface doesn't render properly under IE6 (its fine in firefox) - see attached IE screen grab.
Thanks en8scl for bringing this to my attention, however it works fine on my IE6, Is anyone else having this problem? Perhaps you could upload the html source of that page.
|
|
|
|
|
Logged
|
|
|
|
|
edipo
|
 |
« Reply #9 on: Mar 02, 2006, 09:09 AM » |
|
Hi, I have a stupid question: how I restore the modx backup and the sql database ? Thanks to all
|
|
|
|
|
Logged
|
Sorry for my bad English 
|
|
|
stempy
Jr. Member

Posts: 48
|
 |
« Reply #10 on: Mar 02, 2006, 02:11 PM » |
|
Hi, I have a stupid question: how I restore the modx backup and the sql database ? Thanks to all
Nothing stupid about that edipo. Restoring is a little more complex. File Strcuture: With the zip file, you could upload the entire zip file to your webhosts web documents directory (ie public_html, www, etc) if it's control panel has an extraction option (cpanel's filemanager does), and just extract the zip file, this will create the necessary directories and files, and than you need to change permissions(CHMOD) of the assets dir and folders/files under it. Note though, if the files/folders already exist on the webhost, I think cpanels filemanagers extract stops. So best to delete the old dirs beforehand. Or unzip the archive on your local machine, and FTP the files through, however this can take HEAPS longer, (im on cable and its slow, having to upload every file one by one). Database: If you can use PHPmyadmin or similar database admin on the host, you can use this to upload the database sql file, this will create the database tables. Look for SQL or Query option, and somewhere to upload a .sql file, than browse for your local database_backup.sql (you have to extract this from the .zip first) Ok, when I have some time soon, I'll do a more indepth explanation of the procedure.
|
|
|
|
|
Logged
|
|
|
|
|
edipo
|
 |
« Reply #11 on: Mar 03, 2006, 07:35 AM » |
|
Thanks a lot stempy 
|
|
|
|
|
Logged
|
Sorry for my bad English 
|
|
|
arohner
Jr. Member

Posts: 5
|
 |
« Reply #12 on: Mar 14, 2006, 10:31 AM » |
|
The big move is on the way... I am about to move one of my MODx sites to Dreamhost. I just signed up for their Code Monster deal after much research. I have quite a few sites, and theirs seems to offer the most for the money. So I am transferring all sites that I own to Dreamhost and one of them is a MODx site I just completed for a friend (that she LOVES to update by the way - thanks to MODx!). One of the things that I read about Dreamhost and MODx is that Dreamhost runs PHP as CGI, which can create problems. The solution (from what I have read) is to make sure the domain with MODx is set to run PHP as a module instead. I am going to do that, but it seems as if Dreamhost is really pushing to run PHP as CGI everywhere I look. (In the Control Panel it says "Highly Recommended" next to "Run PHP as CGI" so I am hoping that sometime in the near future they don't 'require' that, and then cause my MODx sites to malfunction. But for now, for the MODx domain, I am going to run PHP as a module. Is it reasonable for me to think Dreamhost could someday 'require' PGP as CGI or is it safe to say that I will always be able to run PHP as a module? I would hate to transfer all sites to Dreamhost, and build more MODx sites, and then have to move to a different host yet again because something like this changed. (Then again, maybe that's a silly thought, but I wanted to ask anyway.  ) Also, I have read about how to work on a MODx site in a staging area and then move it to a live server, but is this module also for moving a live site from one server to another live server? I assume all I do is use the module as instructed, save the files locally, and then FTP the unzipped files to the new server, but I wanted to make sure first because I am fairly new to Modx, and I want to make sure I do it right. (Or I will have an angry Criminal Justice Teacher poking me on the shoulder every chance she gets, asking me why she can't update her web site. Haha.) The MODx site I will be moving is http://www.criminaljusticeteacher.com . Thanks in advance for any advice you can give for this move! 
|
|
|
|
|
Logged
|
|
|
|
|
Djamoer
|
 |
« Reply #13 on: Mar 14, 2006, 11:06 AM » |
|
I can't give any advice regarding about how you're going to move your data and etc, but I use dreamhost, so I know that running php as CGI won't cause any problem, in fact it makes your life even easier, coz you don't have to set permission on folders, because of the fact that it's running under your account, instead of global php account that usually being used by standard php setup. I believe they call this suexec or whatever they named it (I have a bad memory  )
|
|
|
|
|
Logged
|
|
|
|
rthrash
Foundation

Posts: 10,471
|
 |
« Reply #14 on: Mar 14, 2006, 11:08 AM » |
|
Great site looking site by the way... 
|
|
|
|
|
Logged
|
MODx is a framework that allows web professionals to turn over sites to end-users for daily maintenance without worrying. Community participation and questions are encouraged, especially when you help us help you, read the wiki, and review snippet parameters – even if you have to look at the source. Searching the forums helps, too.
Ryan Thrash
MODx Co-Founder
Principal @ Collabpad
work productively.
work intelligently.
work together.
|
|
|
|