Browse Source

modifié : zimbra/Migration/1_export_accounts.sh

modifié :         zimbra/Migration/3_exports_final.sh
	modifié :         zimbra/Migration/3_exports_mailbox.sh
	modifié :         zimbra/Migration/4_imports_mailboxes.sh
	zimbra/Migration/5_exports_filters_and_sig.sh
	zimbra/Migration/6_imports_filters_and_sig.sh
master
Sébastien Faton 12 months ago
parent
commit
d86b24aa05
  1. 2
      zimbra/Migration/1_export_accounts.sh
  2. 2
      zimbra/Migration/3_exports_final.sh
  3. 22
      zimbra/Migration/3_exports_mailbox.sh
  4. 20
      zimbra/Migration/4_imports_mailboxes.sh

2
zimbra/Migration/1_export_accounts.sh

@ -55,6 +55,6 @@ fi
if [ $RCODE -eq 0 ]; then if [ $RCODE -eq 0 ]; then
echo "export terminée !!!!" echo "export terminée !!!!"
echo "lancer l'import sur le serveur source"
echo "lancer l'import sur le serveur Dest"
exit; exit;
fi fi

2
zimbra/Migration/3_exports_final.sh

@ -4,7 +4,7 @@ RCODE=$?
echo "Export mailboxes :" echo "Export mailboxes :"
for user in `cat /opt/zimbra/nfsbackup/migration/accounts/users.txt`; for user in `cat /opt/zimbra/nfsbackup/migration/accounts/users.txt`;
do do
echo "Exporting mailbox $user"; zmmailbox -z -t 0 -m $user getRestURL --startTime $(date -d '-3 day' +%Y/%m/%d) --endTime $(date -d '+1 day' +%Y/%m/%d) -u "https://127.0.0.1:7071" "//?fmt=tgz&resolve=modify" > /opt/zimbra/nfsbackup/migration/archives/$user.tgz ;
echo "Exporting mailbox $user"; zmmailbox -z -t 0 -m $user getRestURL --startTime $(date -d '-3 day' +%Y/%m/%d) --endTime $(date -d '+1 day' +%Y/%m/%d) -u "https://127.0.0.1:7071" "//?fmt=tgz" > /opt/zimbra/nfsbackup/migration/archives/$user.tgz ;
done done
if [ $RCODE -eq 1 ]; then if [ $RCODE -eq 1 ]; then

22
zimbra/Migration/3_exports_mailbox.sh

@ -12,30 +12,8 @@ if [ $RCODE -eq 1 ]; then
exit 1; exit 1;
fi fi
if [ $RCODE -eq 0 ]; then
echo "Export des Filtres"
for user in `cat /opt/zimbra/nfsbackup/migration/accounts/users.txt`; do echo "Exporting Filters : $user" ; zmprov ga $user zimbraMailSieveScript > filters/$user-filters.txt ;done
sed -i -e "1d" /opt/zimbra/nfsbackup/migration/filters/*
sed -i -e 's/zimbraMailSieveScript: //g' /opt/zimbra/nfsbackup/migration/filters/*
if [ $RCODE -eq 1 ]; then
echo "erreur dans l'export des filtres'"
exit 1;
fi
if [ $RCODE -eq 0 ]; then
echo "Export des signatures"
for user in `cat /opt/zimbra/nfsbackup/migration/accounts/users.txt`; do echo "Exporting Default Signature : $user" ; zmprov ga $user zimbraPrefMailSignatureHTML > sig/$user-sig.txt ;done
sed -i -e "1d" /opt/zimbra/nfsbackup/migration/sig/*
sed -i -e 's/zimbraMailSieveScript: //g' /opt/zimbra/nfsbackup/migration/sig/*
if [ $RCODE -eq 1 ]; then
if [ $RCODE -eq 1 ]; then
echo "erreur dans l'export des Signatures'"
exit 1;
fi
if [ $RCODE -eq 0 ]; then if [ $RCODE -eq 0 ]; then
echo "Export terminée'" echo "Export terminée'"
echo "Lancer import sur serveur de destination" echo "Lancer import sur serveur de destination"
exit; exit;
fi fi
fi
fi

20
zimbra/Migration/4_imports_mailboxes.sh

@ -3,7 +3,7 @@ RCODE=$?
for mailbox in `cat /opt/zimbra/nfsbackup/migration/accounts/users.txt`; for mailbox in `cat /opt/zimbra/nfsbackup/migration/accounts/users.txt`;
do do
zmmailbox -z -t 0 -m $mailbox postRestURL -u "https://127.0.0.1:7071" "//?fmt=tgz&resolve=modify" ./$mailbox.tgz ; echo "$mailbox - done ";
echo "Importing mailbox : $user" ;zmmailbox -z -t 0 -m $mailbox postRestURL -u "https://127.0.0.1:7071" "//?fmt=tgz&resolve=modify" /opt/zimbra/nfsbackup/migration/archives/$mailbox.tgz ; echo "$mailbox - done ";
done done
if [ $RCODE -eq 1 ]; then if [ $RCODE -eq 1 ]; then
@ -11,25 +11,7 @@ if [ $RCODE -eq 1 ]; then
exit 1; exit 1;
fi fi
if [ $RCODE -eq 0 ]; then
echo "Import des Filtres"
for user in `cat /opt/zimbra/nfsbackup/migration/accounts/users.txt`; do echo "Importation des filtres : $user"; zmprov ma $user zimbraMailSieveScript "`cat /opt/zimbra/nfsbackup/migration/filters/$user-filters.txt`";done
if [ $RCODE -eq 1 ]; then
echo "erreur dans l'import des filtres'"
exit 1;
fi
if [ $RCODE -eq 0 ]; then
echo "Import des signatures"
for user in `cat /opt/zimbra/nfsbackup/migration/accounts/users.txt`; do echo "Import des signatures: $user"; zmprov csig $user default zimbraPrefMailSignatureHTML "`cat /opt/zimbra/nfsbackup/migration/sig/$user-sig.txt`";done
if [ $RCODE -eq 1 ]; then
if [ $RCODE -eq 1 ]; then
echo "erreur dans l'import des Signatures'"
exit 1;
fi
if [ $RCODE -eq 0 ]; then if [ $RCODE -eq 0 ]; then
echo "Import terminée'" echo "Import terminée'"
exit; exit;
fi fi
fi
fi
Loading…
Cancel
Save