diff --git a/.gitignore b/.gitignore
index 3da26d9d09a8878351baedbcac1c5f73d8a5f9fb..f9a6e6a6e9ea6ddd4234f25a526440de72c35d1d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,10 +14,3 @@ IMG/siteon*
 IMG/test_*
 ecrire/inc_connect.php3
 ecrire/inc_meta_cache.php3
-tmp/data/.htaccess
-tmp/data/.htpasswd
-tmp/data/.htpasswd-admin
-tmp/data/.index
-tmp/data/inc_meta_cache.php3
-tmp/data/session_*
-tmp/data/spip.log*
diff --git a/ecrire/exec/admin_tech.php b/ecrire/exec/admin_tech.php
index a888cae4abf911d027eb5987c033949f309423b6..7cb06e3b4a6dd05d347b42a12858064d545be5dd 100644
--- a/ecrire/exec/admin_tech.php
+++ b/ecrire/exec/admin_tech.php
@@ -38,7 +38,12 @@ function exec_admin_tech_dist()
 		debut_boite_info();
 		echo _T('info_gauche_admin_tech');
 		fin_boite_info();
-		$dir_dump = _DIR_DUMP;
+		$repertoire = _DIR_DUMP;
+		if(!@file_exists($repertoire)) {
+			$repertoire = preg_replace(','._DIR_TMP.',', '', $repertoire);
+			$repertoire = sous_repertoire(_DIR_TMP, $repertoire);
+		}
+		$dir_dump = $repertoire;
 	} else {
 		debut_gauche();
 		$dir_dump = _DIR_TRANSFERT . $connect_login . '/';
diff --git a/ecrire/exec/export_all.php b/ecrire/exec/export_all.php
index bb81a6d0cc2f32bd1c985a73124623cb4acb695f..b4304a0165ac8810560855096e6efed7a21eb3fd 100644
--- a/ecrire/exec/export_all.php
+++ b/ecrire/exec/export_all.php
@@ -56,7 +56,7 @@ if (!isset($EXPORT_tables_noexport)){
 }
 $GLOBALS['flag_ob_flush'] = function_exists('ob_flush');
 
-// http://doc.spip.org/@export_nom_fichier_dump
+// http://doc.spip.org/@export_nom_fichier_dump
 function export_nom_fichier_dump($dir,$gz=true){
 	$archive = _SPIP_DUMP;
 	if ($gz) $archive .= '.gz';
@@ -67,13 +67,18 @@ function export_nom_fichier_dump($dir,$gz=true){
 	return $nom;
 }
 
-// http://doc.spip.org/@exec_export_all_dist
+// http://doc.spip.org/@exec_export_all_dist
 function exec_export_all_dist()
 {
   global $archive, $debut_limit, $etape, $gz, $spip_version, $spip_version_affichee, $version_archive, $connect_login, $connect_toutes_rubriques;
 
 	if ($connect_toutes_rubriques) {
-		$dir = _DIR_DUMP;
+		$repertoire = _DIR_DUMP;
+		if(!@file_exists($repertoire)) {
+			$repertoire = preg_replace(','._DIR_TMP.',', '', $repertoire);
+			$repertoire = sous_repertoire(_DIR_TMP, $repertoire);
+		}
+		$dir = $repertoire;
 	} else {
 		$dir = _DIR_TRANSFERT . $connect_login . '/';
 	}
@@ -261,7 +266,7 @@ function exec_export_all_dist()
 
 }
 
-// http://doc.spip.org/@ramasse_parties
+// http://doc.spip.org/@ramasse_parties
 function ramasse_parties($archive, $gz, $partfile){
 	// a ameliorer par un preg_file
 	// si le rammassage est interrompu par un timeout, on perd des morceaux
@@ -282,7 +287,7 @@ function ramasse_parties($archive, $gz, $partfile){
 //
 // Exportation generique d'objets (fichier ou retour de fonction)
 //
-// http://doc.spip.org/@export_objets
+// http://doc.spip.org/@export_objets
 function export_objets($table, $primary, $liens, $file = 0, $gz = false, $etape_actuelle="", $nom_etape="",$limit=0) {
 	static $etape_affichee=array();
 	static $table_fields=array();
@@ -355,7 +360,7 @@ function export_objets($table, $primary, $liens, $file = 0, $gz = false, $etape_
 
 // Exporter les champs de la table
 
-// http://doc.spip.org/@build_while
+// http://doc.spip.org/@build_while
 function build_while($file,$gz, $nfields, &$pos_in_table, $result, &$status_dump, $table, $fields) {
 	global $connect_toutes_rubriques ;
 	$string = '';
@@ -385,18 +390,18 @@ function build_while($file,$gz, $nfields, &$pos_in_table, $result, &$status_dump
 	return $string;
 }
 
-// http://doc.spip.org/@build_begin_tag
+// http://doc.spip.org/@build_begin_tag
 function build_begin_tag($tag) {
 	return "<$tag>\n";
 }
 
-// http://doc.spip.org/@build_end_tag
+// http://doc.spip.org/@build_end_tag
 function build_end_tag($tag) {
 	return "</$tag>\n\n";
 }
 
 // Conversion texte -> xml (ajout d'entites)
-// http://doc.spip.org/@text_to_xml
+// http://doc.spip.org/@text_to_xml
 function text_to_xml($string) {
 	return str_replace('<', '&lt;', str_replace('&', '&amp;', $string));
 }
diff --git a/ecrire/exec/import_all.php b/ecrire/exec/import_all.php
index 9ee3e9df30e6a6d372b2605eddf8517b36657ac3..05e443b05e00b68801d4ae1dcefcd681376a5d16 100644
--- a/ecrire/exec/import_all.php
+++ b/ecrire/exec/import_all.php
@@ -43,7 +43,12 @@ function verifier_version_sauvegarde ($archive) {
 	global $flag_gz, $connect_toutes_rubriques;
 
 	if ($connect_toutes_rubriques) {
-		$dir = _DIR_DUMP;
+		$repertoire = _DIR_DUMP;
+		if(!@file_exists($repertoire)) {
+			$repertoire = preg_replace(','._DIR_TMP.',', '', $repertoire);
+			$repertoire = sous_repertoire(_DIR_TMP, $repertoire);
+		}
+		$dir = $repertoire;
 	} else {
 		$dir = _DIR_TRANSFERT . $connect_login . '/';
 	}
@@ -127,7 +132,12 @@ function import_all_continue()
 
 	$request = unserialize($meta['request_restauration']);
 	if ($connect_toutes_rubriques) {
-		$dir = _DIR_DUMP;
+		$repertoire = _DIR_DUMP;
+		if(!@file_exists($repertoire)) {
+			$repertoire = preg_replace(','._DIR_TMP.',', '', $repertoire);
+			$repertoire = sous_repertoire(_DIR_TMP, $repertoire);
+		}
+		$dir = $repertoire;
 	} else {
 		$dir = _DIR_TRANSFERT . $connect_login . '/';
 	}
diff --git a/tmp/data/remove.txt b/tmp/data/remove.txt
deleted file mode 100644
index 977321426cfc18189220e566cc5748cc233e21f0..0000000000000000000000000000000000000000
--- a/tmp/data/remove.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-Vous pouvez effacer ce fichier sans dommages.
-
-You can safely remove this file.