Wiki source code of Backup
Version 3.1 by Ludovic Dubost on 2009/10/09
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | #startfloatingbox() | ||
2 | *Contents* | ||
3 | |||
4 | #endfloatingbox() | ||
5 | |||
6 | 1 Backup/Restore | ||
7 | |||
8 | It's crucial that you define a backup strategy for your wiki so that you don't loose any data in case of a problem with your wiki installation. There are 2 strategies defined below. | ||
9 | |||
10 | 1.1 Backup configuration files | ||
11 | |||
12 | There are 2 configuration files you'll need to backup: | ||
13 | * WEB-INF/xwiki.cfg: general XWiki configuration file | ||
14 | * WEB-INF/hibernate.cfg.xml: Hibernate configuration file | ||
15 | |||
16 | In addition you may want to also backup any extra files you'll have installed in your XWiki installation such as JDBC drivers, extra plugins, etc. | ||
17 | |||
18 | To restore them simply copy them at the same location where you backupped them from. | ||
19 | |||
20 | 1.1 Backup your database | ||
21 | |||
22 | XWiki stores all its data in a database so all you need to do to save you wiki's data is backup that database. | ||
23 | |||
24 | If you've installed the default standalone version of XWiki then the data are saved in a Hypersonic SQL database bundled by default. It's located in a database directory inside the directory when you installed XWiki. Simply backup this directory and that'll backup all the Hypersonic SQL database. | ||
25 | |||
26 | If you've installed XWiki using your own database then you'll need a backup tool for that database to back it up and to restore it. | ||
27 | |||
28 | * *MySQL*: you can use "mysqldump xwiki > xwiki.mysqldump" to backup the xwiki schema (do the same for other schemas if you're in multiwiki mode) and "mysql xwiki --user=root -p < xwiki.mysqldump" to restore it. | ||
29 | * *Oracle*: use "exp" to export data and "imp" to restore it. | ||
30 | |||
31 | 1.1 Use the XWiki Import/Export tool | ||
32 | |||
33 | Since all XWiki data are saved in XWiki pages one solution to backup a XWiki instance is simply to export all its pages. This can easily be done using the [Import/Export tool>ImportExport]. However note that this is quite a resource hungry operation and depending on the size of your wiki you may need a lot of memory. As a consequence the recommended backup strategy is to backup the databases. It's much etter to use a specialized backup tool that'll bbackup the database, perform incremental backups, verify backup integrity, etc. | ||
34 | |||
35 | The Import/Export should be reserved for the following use cases: | ||
36 | * move data across XWiki instances, including sharing of applications between separate instances | ||
37 | * move data to another wiki |