2012-12-07 145 views

回答

7

如果您還沒有打包刪除該文件夾的事務,則可以恢復該文件夾。

首先,使用"Undo" tab on the parent folder, in the ZMI。這可能不起作用,系統上的其他許多事物也會發生變化(通常是目錄),以使所有更改有效回滾。

下一步是更麻煩一點,並涉及。然後你需要做的是用一個包裝器打開對象數據庫(ZODB),它會告訴你歷史上給定點的數據庫狀態。這樣做需要手動編輯Zope服務器配置。我有written up the steps in a blog post但這些步驟有點過時。

在一個現代化的Plone構建中,您需要將zc.beforestorage雞蛋添加到您的構建中,並且您需要將Zope的enable-product-installation設置切換爲False;使用beforestorage包裝讓你的數據庫只讀和產品安裝代碼將嘗試提交到數據庫,導致無法啓動:

[instance] 
eggs += 
    zc.beforestorage 
zope-conf-additional += 
    enable-product-installation False 

重建擴建後,你需要打開相關聯的zope.conf文件你的實例。如果您通常使用bin/instance啓動服務器,則該文件位於parts/instance/etc/zope.conf;使用的bin/中的腳本與部件名稱(本例中爲instance)匹配。

找到它定義了ZODB主數據庫中的部分:

<zodb_db main> 
    # Main database 
    cache-size 10000 

    # Blob-enabled FileStorage database 
    <blobstorage> 
     blob-dir /path/to/var/blobstorage 
     <filestorage> 
     path /path/to/var/filestorage/Data.fs 
     </filestorage> 
    </blobstorage> 
    mount-point/
</zodb_db> 

您需要的beforestorage包裝加入到該宣言:

<zodb_db main> 
    # Main database 
    cache-size 10000 

    %import zc.beforestorage 
    <before> 
    before 2012-12-01T12:00:00 

    # Blob-enabled FileStorage database 
    <blobstorage> 
     blob-dir /path/to/var/blobstorage 
     <filestorage> 
     path /path/to/var/filestorage/Data.fs 
     </filestorage> 
    </blobstorage> 

    </before> 

    mount-point/
</zodb_db> 

注意before <iso timestamp>線在那裏;當你開始你的實例時,該網站將按照該時間戳的形式呈現。在刪除文件夾時選擇一個。現在您可以將其導出(再次使用ZMI)到.zexp文件。撤消對zope.conf文件的更改,重新啓動並導入恢復的文件夾。

相關問題