Hi,
That is not really what I want. My problem is that I have an xwiki 1.7.14 and I wanto to
move to a 2.0milestone 2 in another machine. I get a lot of corrupted xar files (cannot
open them with 7zip) because of java memory heap exception (even if they are spaces of
only one page!). So I need a different way of exporting the data, because if I have 40
spaces, 10 xar files are corrupted. Even, I wrote my own snippet to get the spaces
exported selectively, but still getting corrupted xar files. So, ¿is it posible to backup
the database and import it in the new installation?
BTW, I attach the code I wrote for selective space exporting (no optimiced, no
commented).
--------------------
#set($spaces = $xwiki.spaces)
There are $spaces.size() spaces
#set($base ="?format=xar&history=false")
#set( $url=$doc.getURL("export")+$base)
#set( $url=$url.toString.replace("/view/","/export/"))
<table><tr><td>
<form name="a_form">
<textarea type="text" id="a_tbox" name="a_tbox"
value="" cols="30" rows="30"> </textarea>
<input id="b_tbox" name="textarea" ></input>
<a id="the_link" href=" ">
Export
</a>
</form>
</td><td>
<table>
#foreach($space in $spaces)
<tr><td>
#set($contador=0)
#set($parametros = "&name="+$space)
#foreach ($item in $xwiki.getSpaceDocsName($space))
#set($contador=$contador +1)
#set($parametros = $parametros + "&pages=" + $space + "." +
$item )
#end
#set( $parametros=$parametro.toString.replace("/view/","/export/"))
<a href="$url$parametros">Export $space con $contador paginas</a>
</td><td>
<a onclick="javascript:writeit('Añadido $space
\n','a_tbox');appendit('$parametros','b_tbox','the_link')"
>Añadir</a>
</td>
<td>
#set($rdoc = $xwiki.getDocument($space).getTranslatedDocument())
#set($view_url=$rdoc.getURL('view'))
<a href="$view_url/Webhome">Ir</a>
</td>
</tr>
#end
</table>
</td></tr></table>
<script type="text/javascript">
function writeit(txt,cosa)
{
var tbox = document.getElementById(cosa);
if (tbox)
{
tbox.value =tbox.value+ txt;
}
}
function appendit(txt,cosa,link)
{
var tbox = document.getElementById(cosa);
var linkea = document.getElementById(link);
if (tbox)
{
tbox.value = tbox.value+txt;
linkea.href="$url" +tbox.value;
}
}
</script>
--------------------
Thanks
Francisco
-----Mensaje original-----
De: users-bounces(a)xwiki.org [mailto:users-bounces@xwiki.org] En nombre de Steven Calkins
Enviado el: lunes, 07 de septiembre de 2009 17:33
Para: XWiki Users
Asunto: Re: [xwiki-users] Selective space export
Hallo Francisco,
I recently exported my entire database for the first time. I noticed that when you import
the XAR file there are checkboxes that permit you to leave out what you want. Is that what
you need? Xwiki permits choosing which spaces to import, but the choice is on the import
side not the export side. To export the entire DB you need to have Admin rights, though.
Best regards,
Steven Calkins
-----Ursprüngliche Nachricht-----
Von: users-bounces(a)xwiki.org [mailto:users-bounces@xwiki.org] Im Auftrag von Hernández
Cuchí, Francisco Ricardo
Gesendet: Montag, 7. September 2009 12:51
An: XWiki Users
Betreff: [xwiki-users] Selective space export
Hello everybody.
Because of a java memory problem when exporting my wiki, I want to do selective space
exports. The problem is that there is no easy snippet to do it. I found some code to
export one space, and would be great to hace something with chekboxes or similiar to
quickly select wich space to export. I am not good at the scripting language yet, so some
help would be great.
I attach the code for one space exporting
#if(!$request.space)
#set($space = "All")
#else
#set($space = $request.space)
#end
#set($spacesText = {})
#set($spaces = $xwiki.spaces)
#set($ok = $spacesText.put("All","All"))
#foreach($space in $spaces)
#set($ok = $spacesText.put($space,$space))
#end
#macro(spaceoption $space $selectspace $spacesText)
<option value="$spacesText.get($space)" #if($selectspace ==
$spacesText.get($space))selected="selected"#end>$space</option>
#end
#macro(spaceselect $selectspace $spaces $spacesText)
<select name="space">
#spaceoption("All" $selectspace $spacesText)
#foreach($space in $spaces)
#spaceoption($space $selectspace $spacesText)
#end
</select>
#end
<form action="">
{pre}
<div class="centered">
Space #spaceselect($space $spaces $spacesText) <input type="submit"
value="Ver"/>
</div>
{/pre}
</form>
#if ($request.space)
1.1 List of docs that will be Exported
#set($parametros = "?format=xar&history=false&name="+$space)
#foreach ($item in $xwiki.getSpaceDocsName($request.space))
* $item
#set( $parametros = $parametros + "&pages=" + $space + "." +
$item )
#end
#set( $parametros=$doc.getURL("export")+$parametros )
#set( $parametros=$parametro.toString.replace("/view/","/export/"))
<a href="$parametros">Exportar</a>
#end
--
Francisco Hernández Cuchí
Jefe de Servicios Sistemas de Información
OFICINA ESPAÑOLA DE PATENTES Y MARCAS
**********************************************************************************************
IMPORTANTE: El contenido de este correo y ficheros adjuntos es confidencial y está
dirigido únicamente para el destinatario/s.
Si Ud recibe este correo por error, por favor póngase en contacto con su administrador de
correo o con el emisor immediatamente y no difunda su contenido a nadie ni haga copias.
*** Este correo ha sido escaneado de virus y contenido malicioso ***
**********************************************************************************************
_______________________________________________
users mailing list
users(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/users
_______________________________________________
users mailing list
users(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/users
**********************************************************************************************
IMPORTANTE: El contenido de este correo y ficheros adjuntos es confidencial y está
dirigido únicamente
para el destinatario/s.
Si Ud recibe este correo por error, por favor póngase en contacto con su administrador de
correo o con el
emisor immediatamente y no difunda su contenido a nadie ni haga copias.
*** Este correo ha sido escaneado de virus y contenido malicioso ***
**********************************************************************************************