1234567891011 |
- version=pmwiki-2.1.14 ordered=1 urlencoded=1
- agent=Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.0.6) Gecko/20060728 SUSE/1.5.0.6-1.3 Firefox/1.5.0.6
- author=Pm
- csum=
- ctime=1134693395
- host=24.1.26.255
- name=PmWiki.BackupAndRestore
- rev=7
- targets=PmWiki.DocumentationIndex
- text=This page has some background information on making backups and explains some basic *nix backup and restore procedures.%0a%0a!! Introduction%0a%0aYour wiki installation contains some unique data in the following directories:%0a%0a local/ Local configuration scripts%0a cookbook/ Recipes obtained from the [[(Cookbook:)Cookbook]]%0a pub/ Publicly accessible files%0a wiki.d/ Wiki pages%0a uploads/ Uploaded files (attachments)%0a%0aA good backup plan will include periodically archiving these directories — or at bare minimum [@local/@] and [@wiki.d/@]. Good practice dictates keeping your backup archives on a separate machine.%0a%0a!! Simple Backup and Restore (*nix)%0a%0aWhen it comes to backup, simpler is better. Since the pmwiki distribution is very small (about 1/4 megabyte), it's simplest to just archive the distribution files along with the data.%0a%0a!!! Making a Backup Archive%0a%0aThe following *nix command, executed from the parent directory of your wiki's directory, will put a complete backup archive of your site in your home directory.%0a%0a-> [@%0atar -zcvf ~/wiki-backup-`date +%25Y%25m`.tar.gz wiki/%0a@]%0a%0a!!! Restoring the Backup Archive%0a%0a!!!! Simple Method%0a%0aYour site can be restored and running in under 30 seconds with%0a%0a-> [@%0atar -zxvf ~/wiki-backup-200512.tar.gz%0afind wiki/uploads/ -type d |xargs chmod 777%0afind wiki/wiki.d/ -type d |xargs chmod 777%0a@]%0a%0a!!!! A Slightly-More-Secure Method%0a%0aThe simple restore commands above will give you world-writable files and directories. You can avoid world-writable permissions by letting PmWiki create directories with the proper attributes (ownership and permissions) for you.%0a%0aStart with%0a%0a-> [@%0atar -zxvf ~/wiki-backup-200512.tar.gz%0arm -rf wiki/wiki.d%0arm -rf uploads%0achmod 2777 wiki/%0a@]%0a%0aNow upload a file in each group that had uploads. If your site doesn't have uploads, just visit your site once so the wiki.d/ directory will be created.%0a%0aFinish your installation with%0a%0a-> [@%0achmod 755 wiki/%0atar -zxvf ~/wiki-backup-200512.tar.gz%0a@]%0a%0a%0a!!! Details%0a%0aThe commands on this page assume your site is in a directory called "wiki/". The test backup was made in December, 2005 so it's named accordingly.%0a%0aYour site will only have an uploads/ directory if uploads are enabled.%0a%0aThe backup command uses a date stamp (YYYYMM) in the filename. If you automate the command via cron you'll wind up with monthly snapshots of your site. You can get a daily snapshot by appending %25d to the date command ([@`date +%25Y%25m%25d`@] will get you YYYYMMDD). Be wary of space limitations if you have a large uploads/ directory.%0a%0a%0a!! See Also%0a%0a* A [[http://thread.gmane.org/gmane.comp.web.wiki.pmwiki.user/20317| thread]] [gmane.org] on the pmwiki-users mailing list.%0a* A [[(Cookbook:)BackupPages]] recipe in the cookbook.%0a%0a%25trail%25%3c%3c|[[DocumentationIndex]]|>>
- time=1156526539
|