Switch to the Database Attachment Store
Steps
The database attachment store keeps the content of an attachment in the wiki database instead of on disk, which makes a dump of the database a complete backup of the wiki; The Attachment Store compares the two stores and Optional Store Features lists what each of the properties below decides.
This is a configuration change, not a migration. It sets the store used for the next attachment saved; every attachment already written to the filesystem stays there, and is still served from there.
- Stop XWiki.
- Open xwiki/WEB-INF/xwiki.cfg and set the four storage hints to hibernate:
xwiki.store.attachment.hint=hibernate xwiki.store.attachment.versioning.hint=hibernate xwiki.store.attachment.recyclebin.content.hint=hibernate xwiki.store.recyclebin.content.hint=hibernateAll four ship commented out, so uncommenting them is part of the change: a line left commented keeps its default whatever value you wrote on it. The last of the four is the store for deleted Pages rather than for deleted attachments, and it belongs here because a Page carries its attachments with it into the recycle bin.
- Start XWiki again.
- Attach a file to any Page, then look for its content in the database:
SELECT COUNT(*) FROM xwikiattachment_content;The table gains a row, the file you have just attached. It does not gain a row for every attachment already in the wiki, and nothing new appears under store/file in the permanent directory: the older attachments are still on disk, exactly as they were.
From here on the wiki is under the size ceiling of the database store: an attachment much larger than 30 MB cannot be saved, for the reason The Attachment Store gives.