Jun 15, 2026

PmWiki

PmWiki

pmwiki.org

edit SideBar

Search

ãƒãƒƒã‚¯ã‚¢ãƒƒãƒ—ã¨ãƒªã‚¹ãƒˆã‚¢

This page has some background information on making backups and explains some basic *nix backup and restore procedures.

ã“ã®ãƒšãƒ¼ã‚¸ã¯ã€ãƒãƒƒã‚¯ã‚¢ãƒƒãƒ—を作るã“ã¨ã«ã¤ã„ã¦ã‚る背景的情報をæŒã£ã¦ãŠã‚Šã€ã„ãã¤ã‹ã®åŸºç¤Žçš„㪠*nix ãƒãƒƒã‚¯ã‚¢ãƒƒãƒ—ã¨ãƒªã‚¹ãƒˆã‚¢æ‰‹ç¶šãã«ã¤ã„ã¦èª¬æ˜Žã—ã¾ã™ã€‚

Introduction

Your wiki installation contains some unique data in the following directories:

ã‚ãªãŸã® wiki installation ã¯ã€ã„ãã¤ã‹ã®(ã‚ãªãŸ)独自ã®ãƒ‡ãƒ¼ã‚¿ã‚’以下ã®ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã«ä¿æŒã—ã¦ã„ã¾ã™:

    local/         Local configuration scripts
    cookbook/      Recipes obtained from the Cookbook
    pub/           Publicly accessible files
    wiki.d/        Wiki pages
    uploads/       Uploaded files (attachments)

    local/         Local configuration scripts
    cookbook/      Cookbook ã‹ã‚‰æ‰‹ã«å…¥ã‚ŒãŸãƒ¬ã‚·ãƒ”
    pub/           共通ã«ã‚¢ã‚¯ã‚»ã‚¹å¯èƒ½ãªãƒ•ァイル(訳注:skins ã‚‚ã“ã“)
    wiki.d/        Wiki ページ
    uploads/       アップロードã•れãŸãƒ•ァイル (attachments)

A 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.

よã„ãƒãƒƒã‚¯ã‚¢ãƒƒãƒ—計画ã¯å®šæœŸçš„ã«ã“れらã®ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªãƒ¼â€•ã‚ã‚‹ã„ã¯æœ€ä½Žé™ local/ 㨠wiki.d/ をアーカイブã«ä¿ç®¡ã™ã‚‹ã“ã¨ã‚’å«ã‚€ã§ã—ょã†ã€‚ã‚ãªãŸã®ãƒãƒƒã‚¯ã‚¢ãƒƒãƒ—ãƒ»ã‚¢ãƒ¼ã‚«ã‚¤ãƒ–ã‚’åˆ¥ã®æ©Ÿæ¢°ä¸Šã§ç¶­æŒã—ã¦æ›¸ãå–らã›ã‚‹ã®ã¯è‰¯ã„ç¿’æ…£ã§ã™ã€‚

Simple Backup and Restore (*nix)

When 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.

ãƒãƒƒã‚¯ã‚¢ãƒƒãƒ—ã¨ãªã‚Œã°ã€ã‚·ãƒ³ãƒ—ãƒ«ãªæ–¹ãŒè‰¯ã„ã§ã—ょã†ã€‚pmwiki é…布ã¯ã€ã¨ã¦ã‚‚å°ã•ã„(ãŠã‚ˆã 1/4メガãƒã‚¤ãƒˆ)ã®ã§ã€ãƒ‡ãƒ¼ã‚¿ã¨å…±ã«é…布ファイルをå˜ã«ã‚¢ãƒ¼ã‚«ã‚¤ãƒ–ã«ä¿ç®¡ã™ã‚‹ã“ã¨ã¯æœ€ã‚‚å˜ç´”ã§ã™ã€‚

Making a Backup Archive

The 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.

ã‚ãªãŸã® wiki ディレクトリã®è¦ªãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã‹ã‚‰å®Ÿè¡Œã•れる以下㮠*nix コマンドã¯ã€ã‚ãªãŸã®(wiki)サイトã®å®Œå…¨ãªãƒãƒƒã‚¯ã‚¢ãƒƒãƒ—ã‚’ã‚ãªãŸã®ãƒ›ãƒ¼ãƒ ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã«å‡ºåŠ›ã™ã‚‹ã§ã—ょã†ã€‚

tar -zcvf  ~/wiki-backup-`date +%Y%m`.tar.gz  wiki/

Restoring the Backup Archive

Simple Method

Your site can be restored and running in under 30 seconds with

tar -zxvf ~/wiki-backup-200512.tar.gz
find wiki/uploads/ -type d |xargs chmod 777
find wiki/wiki.d/ -type d |xargs chmod 777

A Slightly-More-Secure Method ã‚‚ã†ã¡ã‚‡ã£ã¨å®‰å…¨(Secure)ãªæ–¹æ³•

(訳注:ã“れã§ã¯ã€è‚心ã®ãƒ‡ãƒ¼ã‚¿ãŒãƒªã‚¹ãƒˆã‚¢ã•れãªã„ã¨æ€ãˆã‚‹ãŒ...謎)

The 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.

上記ã®ç°¡å˜ãªãƒªã‚¹ãƒˆã‚¢ã‚³ãƒžãƒ³ãƒ‰ã¯èª°ã§ã‚‚書ãè¾¼ã¿å¯èƒ½ãªãƒ•ァイルã¨ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã‚’ã‚ãªãŸã«ä¸Žãˆã¾ã™ã€‚é©åˆ‡ãªå±žæ€§(所有権ã¨è¨±å¯)ã‚’å‚™ãˆãŸãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã‚’ PmWiki ã«ä½œæˆã•ã›ã‚‹ã“ã¨ã«ã‚ˆã‚Šã€èª°ã§ã‚‚書ãè¾¼ã¿å¯èƒ½ãªè¨±å¯(permissions)を回é¿ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚

Start with

tar -zxvf ~/wiki-backup-200512.tar.gz
rm -rf wiki/wiki.d
rm -rf uploads
chmod 2777 wiki/

Now 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.

今度ã¯ã€uploads ã‚’æŒã£ã¦ã„ãŸå„グループã§ãƒ•ァイルをアップロードã—ã¦ãã ã•ã„。 ã‚ãªãŸã®ã‚µã‚¤ãƒˆã« uploads ãŒãªã„ãªã‚‰ã€wiki.d/ディレクトリãŒä½œæˆã•れるãŸã‚ã«ä¸€åº¦ãŸã ãã¡ã‚‰ã®ã‚µã‚¤ãƒˆã‚’見ã¦ãã ã•ã„。

Finish your installation with

chmod 755 wiki/
tar -zxvf ~/wiki-backup-200512.tar.gz

Details

The 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.

ã“ã®ãƒšãƒ¼ã‚¸ã®ã‚³ãƒžãƒ³ãƒ‰ã¯ã€ã‚ãªãŸã®ã‚µã‚¤ãƒˆãŒ "wiki/" ã¨å‘¼ã°ã‚Œã‚‹ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã«ã‚ã‚‹ã¨ä»®å®šã—ã¦ã„ã¾ã™ã€‚テスト・ãƒãƒƒã‚¯ã‚¢ãƒƒãƒ—ã¯ã€ãれらã—ãåå‰ã‚’付ã‘られるよã†ã«ã€2005å¹´12月ã«ä½œã‚‰ã‚Œã¾ã—ãŸã€‚

Your site will only have an uploads/ directory if uploads are enabled.

ã‚ãªãŸã®ã‚µã‚¤ãƒˆã«ã¯ã€ã‚¢ãƒƒãƒ—ロードãŒå¯èƒ½ã«ã•れる場åˆã«ã ã‘〠uploads/ ディレクトリãŒã‚ã‚‹ã§ã—ょã†ã€‚

The 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 %d to the date command (`date +m%d` will get you YYYYMMDD). Be wary of space limitations if you have a large uploads/ directory.

ãƒãƒƒã‚¯ã‚¢ãƒƒãƒ—コマンドã¯ã€ãƒ•ァイルåã®ä¸­ã«æ—¥ä»˜ã‚¹ã‚¿ãƒ³ãƒ—を使ã£ã¦ã„ã¾ã™ã€‚cronã«ã‚ˆã£ã¦ã‚³ãƒžãƒ³ãƒ‰ã‚’自動化ã™ã‚Œã°ã€ã‚µã‚¤ãƒˆã®æ¯Žæœˆã®ã‚¹ãƒŠãƒƒãƒ—ショットã§ç· ã‚ããã‚‹ã§ã—ょã†ã€‚date コマンド㫠%d を追加ã™ã‚Œã°ã€æ—¥æ¯Žã®ã‚¹ãƒŠãƒƒãƒ—ショットを撮れã¾ã™ (`date +m%d` will get you YYYYMMDD)。大ãã„ uploads/ ディレクトリãŒã‚ã‚‹å ´åˆã¯ã€ã‚¹ãƒšãƒ¼ã‚¹åˆ¶é™ã¯ç”¨å¿ƒã—ã¦ãã ã•ã„。

See Also

  • A thread [gmane.org] on the pmwiki-users mailing list.
  • A BackupPages recipe in the cookbook.

<< BackupAndRestore? | ドキュメント目次 | Finding orphaned and missing pages? >>

Page Actions

Recent Changes

Group & Page

Back Links