====== Talk:Projects:BackupTool for DokuWiki ====== * Start all subtopics using H2. (Heading 2.) ===== Note to users: Tarlib doesn't work! ===== Hi everyone, let me state for the record that "tarlib", which is part of DokuWiki's core, **currently does not generate working tar files in all situations**. I've discussed this on the DokuWiki mailing list several times, and have filed (if I recall) at least two bug reports about it. * The latest bug report I've filed (yet to be resolved) is [[http://bugs.splitbrain.org/index.php?do=details&task_id=1442|here]]. * The latest mailing list discussion for this is [[http://www.freelists.org/archives/dokuwiki/07-2008/msg00030.html|here]]. ==== Tarlib version (non-working) ==== Here is a version that attempts to use tarlib (part of DW) to write the archive directly into the media folder. The tar file it creates for some reason seems to be corrupt (or at least it won't verify in my local archive manager, 7-zip.) I suspect it's either: * Checksum generated is incorrect * Format is otherwise incorrect * Possibly DW's version of tarlib is out of date? I'm not horribly sure but I can't guarantee I'll be able to fix it in a timely manner, so if someone would like to investigate, I'd appreciate it. {{:wiki:talk:projects:backuptool-tarlib-nonworking.zip|Download backuptool-tarlib-nonworking.zip}} --- //[[tjgrant@tatewake.com|Terence J. Grant]] 09/17/2006 00:04// ==== More problems with tarlib ==== I've done some testing since last night... * tar files appear to be ok as long as you don't add directories * gnu tar doesn't appear to be able to verify the corrupted tar files * files with more than 100 characters in their path don't get added (uh-oh) --- //[[tjgrant@tatewake.com|Terence J. Grant]] 09/17/2006 12:29// ==== Andreas Wagner's tarlib version ==== A little better, but still has the same problems: {{wiki:talk:projects:wagner-backup-tool.tar.bz2|Andreas Wagner's Version}} You'll need to make a "tmp" directory in your data directory and chmod it 777 to test it. --- //[[tjgrant@tatewake.com|Terence J. Grant]] 07/10/2008 03:34// ===== Initial release jitters ===== Hi all, I've gone ahead and put a list of all the known issues below; each of which is solveable, but currently still outstanding. Feel free to help me complete these early-- it'll result in a faster release and more time spent on other projects. --- //[[tjgrant@tatewake.com|Terence J. Grant]] 07/29/2006 05:44// ===== More files to backup? ===== If you're aware of any important files I'm missing in the backup process, please list it below as file paths, thanks. --- //[[tjgrant@tatewake.com|Terence J. Grant]] 07/29/2006 05:28// * conf/mime.conf Hello, I would appreciate if your tool could also backup //conf/mime.conf//. Some plugins like [[http://wiki.splitbrain.org/plugin:freemind|freemind]] need to have changes in //mime.conf//. Thank you. deKesi ===== Displaying page as multi-part ===== Anyone have an idea on how to display the page as each individual section completes? I believe I'm doing everything right in this regard, but obviously the sever still wishes to wait until the page is completely loaded. So any help on this would be appreciated. --- //[[tjgrant@tatewake.com|Terence J. Grant]] 07/29/2006 05:28// === Tar and GZip/BZip commands === >For the archiving commands ('tar') things might be a little more complex. The plugin manager includes two php classes, //tarlib// and //zip.lib//, I only use them for extraction in the plugin manager but a quick look makes me think they can handle archive creation and compression. Ok, I'll look into this as well. --- //[[tjgrant@tatewake.com|Terence J. Grant]] 08/20/2006 20:42// ==== The harder stuff ==== >>My other ideas are: >> * option to send the backup as part of its creation, ie, the web browser will pop up its download window there and then and the admin can save the backup immediately. >Yeah, I agree... I believe this should be doable via a document.location.href javascript... or it could be delivered directly via the right combination of multipart-mixed headers, but frankly i don't know how to do the latter.--- //[[tjgrant@tatewake.com|Terence J. Grant]] 08/20/2006 20:42// Its quite straight forward. The easiest way is to simply do a server side redirect to the backup file once its been created. Its also possible to send the data inline as an attachment. Both methods are descibed under ''[[http://www.php.net/manual/en/function.header.php|header()]]''. --- //[[chris@jalakai.co.uk|Chris Smith]] 2006/08/21 19:44// >> * if a current backup exists, add option to only download that backup. For this, it might be necessary to be able to determine what file types are included in the backup. >Hmm, I think keeping the current backup around (or accessible to anyone but superuser) would be a security risk... password hashes, pages with permissions, etc could all be compromised. --- //[[tjgrant@tatewake.com|Terence J. Grant]] 08/20/2006 21:08// I wasn't thinking of it being generally available. Perhaps the installer could create a protected "backup" namespace in the media tree. Or perhaps it is a bad idea. --- //[[chris@jalakai.co.uk|Chris Smith]] 2006/08/21 19:44// >>I'm prepared to help out with these changes if you don't mind. >Anything you'd like to do, feel free. I'll try to improve some things when I get a chance as well. --- //[[tjgrant@tatewake.com|Terence J. Grant]] 08/20/2006 20:42// >>In reply to some of your other points above: >> * %%`date "+%W"`%% included in the file name will add a week number. Do ''man date'' to see the other format codes. e.g.'tar -rf backup-`date "+%W"`.tar '.$conf['olddir'] You will probably need to escape the backticks or change the quote marks from double to single to ensure PHP passes them to the shell >I was thinking of using the php date function originally, since myself I do backups fairly irregularly. (Sometimes I'll do twice in a day if i've had some significant changes.) The only concern I had was regarding replacing slashes in the date with dashes or something --- //[[tjgrant@tatewake.com|Terence J. Grant]] 08/20/2006 20:42// [[http://www.php.net/manual/en/function.date.php|date]] will work too. Try something like, "backup-".date("Ymd-Hi").".tar" --- //[[chris@jalakai.co.uk|Chris Smith]] 2006/08/21 19:44// > * take a look at Andi's [[http://wiki.splitbrain.org/plugin:searchindex_manager|searchindex plugin]]. It uses continuous page updating to show its progress. Ok, I'll take a look at that. --- //[[tjgrant@tatewake.com|Terence J. Grant]] 08/20/2006 20:42// >> * what is upgdate? >I misspelled update... the update button in the plugin manager. I couldn't find anything referencing it but truthfully I didn't look for very long either. --- //[[tjgrant@tatewake.com|Terence J. Grant]] 08/20/2006 20:42// The plugin manager stores information about any plugin it installs, including the source url. Update, simply attempts to retrieve and reinstall the plugin again from the same url. At this time there is no intelligence behind it, ie, it doesn't know if the plugin has been updated or even if the url is still live. --- //[[chris@jalakai.co.uk|Chris Smith]] 2006/08/21 19:44// >Cheers --- //[[chris@jalakai.co.uk|Chris Smith]] 2006/08/20 23:57// ===== Thanks ===== > Thank you for yourbackup tool! Any plans to make automaticly make daily/weekly backups or the option to send the backup to a certain mailadress? I personally don't have any plans myself for this-- feel free to add options and send them to me (see [[:svn]] for some tips.) Automated backups could be done with what's called a [[wp>Crontab|cron job]], but most people don't have access to this. As for mailing; I wouldn't know how to begin, though I suspect this might be easier. Again, contributions (within reason) are welcome. --- //[[tjgrant@tatewake.com|Terence J. Grant]] 08/22/2007 17:08// ===== No such file ===== >I have downloaded this plugin and all went ok, but when I proces the back-up I should find a back-up file in the root ("The backup file is generated and put in the root of your media directory"). >But there is no such file. What can be wrong? ---//FJH Langendam 08/20/2008// The file should be created in the "root of your media directory," so this does not mean your "file system root," this means the top level media directory. In other words, it should be creating a file in your "data/media" directory. Is this not happening? --- //[[tjgrant@tatewake.com|Terence J. Grant]] 08/20/2008 23:08// ===== Another Question ===== >Dear Terence, >I've tried it again and although dokuwiki shows the name of the bu-file (dw-backup-20080821-220132.tar.bz2) it's not in the dir (httpdocs/doku/data/media). --- //FJH Langendam 08/21/2008// Hi FJH, There's a link generated on the BackupTool page, I'd suggest using that to get the file. I'd also suggest using the media manager to delete the file. Hope that helps, --- //[[tjgrant@tatewake.com|Terence J. Grant]] 12/20/2008 17:03// ===== compression type configurable ===== >Hi Terence and thanks for your updates of this plugin. > >I've just launched a new wiki at some site the php of which announces availability of bz2 but fails on generating anything bz2-y (also old revisions cannot be generated with bz2, e.g.), so I had to hack the code to force gzip compression. Would you consider adding the compression-type to the configurable options? (So I don't have to hack again when there's an update of the plugin.) --- //Andreas Wagner 11/25/2008// Hi Andreas, yes, I'll add the option as time permits. --- //[[tjgrant@tatewake.com|Terence J. Grant]] 12/20/2008 16:56// ===== Question about Tool ===== > - Can this tool be used to migrate data from one instance of DokuWiki to another instance running on some other host? \\ > - Does this tool work for Windows? > - (also side note: anyone know why my H2 is not being properly rendered by dokuwiki? Is the a maximum size to a page? Is there some syntax error somewhere above me?) --- //Peter Thung 12/16/2008// \\ Hi Peter, - Yes, it should be able to. There is some manual configuration that will need to be done to restore, but it's very minimal. - It will work on Windows if you do one of two things-- you'll have to decide which is easier to configure, though): * Install tar and gzip (or tar, gzip, and bz2) via [[http://cygwin.com|Cygwin]] for Windows and make it available to the server. (Or use a similar method to make tar, gzip2 * Install [[http://pear.php.net/|Pear]] for your PHP installation. - Usually these are syntax errors (mismatched "=====" or "%%**%%" signs for instance), but these are questions you should ask on the [[http://forum.dokuwiki.org|DokuWiki forum]]. Best of luck, --- //[[tjgrant@tatewake.com|Terence J. Grant]] 12/20/2008 16:56//