<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Migrate export scripting in Cloud Firewall</title>
    <link>https://community.checkpoint.com/t5/Cloud-Firewall/Migrate-export-scripting/m-p/98871#M1938</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;If I understand correctly, DH_ND is trying to run a frequent 'migrate export'.&lt;/P&gt;&lt;P&gt;And to my knowledge, there is always a cpstop/mdsstop required. And of course the start of the services again. Which creates always an unavailability of MGMT. Other admins can't connect or are being disconnected.&lt;/P&gt;&lt;P&gt;Depending on the requirement, backup/mds_backup might be a good alternative.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 12 Oct 2020 12:50:02 GMT</pubDate>
    <dc:creator>S_E_</dc:creator>
    <dc:date>2020-10-12T12:50:02Z</dc:date>
    <item>
      <title>Migrate export scripting</title>
      <link>https://community.checkpoint.com/t5/Cloud-Firewall/Migrate-export-scripting/m-p/98648#M1934</link>
      <description>&lt;P&gt;Hi Checkmates&lt;/P&gt;&lt;P&gt;I've been tasked with taking a migrate export once a week from several of our SMS devices in the Azure&amp;nbsp;and copying it to a share.Is it possible to script and schedule this operation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Oct 2020 10:38:48 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Cloud-Firewall/Migrate-export-scripting/m-p/98648#M1934</guid>
      <dc:creator>DH_ND</dc:creator>
      <dc:date>2020-10-09T10:38:48Z</dc:date>
    </item>
    <item>
      <title>Re: Migrate export scripting</title>
      <link>https://community.checkpoint.com/t5/Cloud-Firewall/Migrate-export-scripting/m-p/98654#M1935</link>
      <description>&lt;P&gt;You can call &lt;CODE&gt;$FWDIR/bin/upgrade_tools/migrate&lt;/CODE&gt; from a script, but the export file is written locally. You will need a second script to do the file transfer later.&lt;/P&gt;
&lt;P&gt;If you use GAiA WebGUI System Management &amp;gt; Job Scheduler, define three jobs: One with the migrate export command, a second for the file transfer and a third for deleting the export file.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Oct 2020 12:15:48 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Cloud-Firewall/Migrate-export-scripting/m-p/98654#M1935</guid>
      <dc:creator>G_W_Albrecht</dc:creator>
      <dc:date>2020-10-09T12:15:48Z</dc:date>
    </item>
    <item>
      <title>Re: Migrate export scripting</title>
      <link>https://community.checkpoint.com/t5/Cloud-Firewall/Migrate-export-scripting/m-p/98659#M1936</link>
      <description>&lt;P&gt;Thanks. IM pretty new to scripting do you hvae any examples?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;</description>
      <pubDate>Fri, 09 Oct 2020 14:20:14 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Cloud-Firewall/Migrate-export-scripting/m-p/98659#M1936</guid>
      <dc:creator>DH_ND</dc:creator>
      <dc:date>2020-10-09T14:20:14Z</dc:date>
    </item>
    <item>
      <title>Re: Migrate export scripting</title>
      <link>https://community.checkpoint.com/t5/Cloud-Firewall/Migrate-export-scripting/m-p/98663#M1937</link>
      <description>&lt;P&gt;I built &lt;A href="https://www.cpug.org/forums/showthread.php/22827-automated-MDS-backup?p=100197#post100197" target="_self"&gt;this script&lt;/A&gt; which handles the creation and deletion of the exports. It doesn't currently handle copying the file off, because I didn't have a key-based SSH server handy at the time, but that part is the easiest to automate.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Edited to add&lt;/STRONG&gt;: To clarify, that exact script is for mds_backup files. It should be pretty easy to modify for migrate export on a SmartCenter. You would need to change the "Run the backup" section, the&amp;nbsp;*.mdsbk.* part in the SCP section and the "If the SCP worked" section, and the subject and body in the emails at the beginning and end. The file rotation logic is sound.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Oct 2020 15:24:22 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Cloud-Firewall/Migrate-export-scripting/m-p/98663#M1937</guid>
      <dc:creator>Bob_Zimmerman</dc:creator>
      <dc:date>2020-10-09T15:24:22Z</dc:date>
    </item>
    <item>
      <title>Re: Migrate export scripting</title>
      <link>https://community.checkpoint.com/t5/Cloud-Firewall/Migrate-export-scripting/m-p/98871#M1938</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;If I understand correctly, DH_ND is trying to run a frequent 'migrate export'.&lt;/P&gt;&lt;P&gt;And to my knowledge, there is always a cpstop/mdsstop required. And of course the start of the services again. Which creates always an unavailability of MGMT. Other admins can't connect or are being disconnected.&lt;/P&gt;&lt;P&gt;Depending on the requirement, backup/mds_backup might be a good alternative.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Oct 2020 12:50:02 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Cloud-Firewall/Migrate-export-scripting/m-p/98871#M1938</guid>
      <dc:creator>S_E_</dc:creator>
      <dc:date>2020-10-12T12:50:02Z</dc:date>
    </item>
    <item>
      <title>Re: Migrate export scripting</title>
      <link>https://community.checkpoint.com/t5/Cloud-Firewall/Migrate-export-scripting/m-p/98883#M1939</link>
      <description>&lt;P&gt;Hi S_E_&lt;/P&gt;&lt;P&gt;Yes thats correct. These will be run during the night so unless we are experiencing issues then other admins won't be on. If services need to be started we can always use the console thorugh Azure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Oct 2020 14:03:37 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Cloud-Firewall/Migrate-export-scripting/m-p/98883#M1939</guid>
      <dc:creator>DH_ND</dc:creator>
      <dc:date>2020-10-12T14:03:37Z</dc:date>
    </item>
    <item>
      <title>Re: Migrate export scripting</title>
      <link>https://community.checkpoint.com/t5/Cloud-Firewall/Migrate-export-scripting/m-p/140588#M1940</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;We are trying to use job scheduler for creating migrate export, but it is not working. We are using the below configuration.&lt;/P&gt;&lt;P&gt;add cron job Config_Backup command "/opt/CPsuite-R81/fw1/bin/upgrade_tools/migrate export /var/log/MigrateExport/Mgmt_Backup -n" recurrence daily time 21:40&lt;/P&gt;&lt;P&gt;could you please confirm if we have to consider anything to make it working.&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 05 Feb 2022 04:55:34 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Cloud-Firewall/Migrate-export-scripting/m-p/140588#M1940</guid>
      <dc:creator>Arunkumar</dc:creator>
      <dc:date>2022-02-05T04:55:34Z</dc:date>
    </item>
    <item>
      <title>Re: Migrate export scripting</title>
      <link>https://community.checkpoint.com/t5/Cloud-Firewall/Migrate-export-scripting/m-p/140656#M1941</link>
      <description>&lt;P&gt;If you are using a relatively new version, you should probably be using the new API / management CLI command for migrate export:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://sc1.checkpoint.com/documents/latest/APIs/#cli/migrate-export-domain~v1.8%20" target="_blank"&gt;https://sc1.checkpoint.com/documents/latest/APIs/#cli/migrate-export-domain~v1.8%20&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 06 Feb 2022 06:49:39 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Cloud-Firewall/Migrate-export-scripting/m-p/140656#M1941</guid>
      <dc:creator>Tomer_Noy</dc:creator>
      <dc:date>2022-02-06T06:49:39Z</dc:date>
    </item>
    <item>
      <title>Re: Migrate export scripting</title>
      <link>https://community.checkpoint.com/t5/Cloud-Firewall/Migrate-export-scripting/m-p/141308#M1942</link>
      <description>&lt;P&gt;Thanks for the details. I have even tried like below and it is working.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;add cron job Config_Backup command "source /etc/profile.d/CP.sh ; /opt/CPsuite-R81/fw1/bin/upgrade_tools/migrate export /var/log/MigrateExport/Mgmt_Backup -n" recurrence daily time 21:40&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Feb 2022 10:16:17 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Cloud-Firewall/Migrate-export-scripting/m-p/141308#M1942</guid>
      <dc:creator>Arunkumar</dc:creator>
      <dc:date>2022-02-12T10:16:17Z</dc:date>
    </item>
    <item>
      <title>Re: Migrate export scripting</title>
      <link>https://community.checkpoint.com/t5/Cloud-Firewall/Migrate-export-scripting/m-p/248219#M5310</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I am trying to replicate your solution but it's not working for me, I think that is because I am using variables in the file name, this is my command:&lt;/P&gt;&lt;P&gt;add cron job backup command "source /etc/profile.d/CP.sh ; /opt/CPsuite-R81.20/fw1/scripts/migrate_server export -v R81.20 --ignore_warnings /var/log/backups/Export_server_-$(date +"%d-%m-%Y").tgz -n" recurrence daily time 18:18&lt;/P&gt;&lt;P&gt;The command "/opt/CPsuite-R81.20/fw1/scripts/migrate_server export -v R81.20 --ignore_warnings /var/log/backups/Export_server_-$(date +"%d-%m-%Y").tgz -n" works perfectly on CLI, so it is not a syntax problem,&lt;/P&gt;&lt;P&gt;If I remove the "$(date +"%d-%m-%Y")" part the command is accepted by cron, both in CLI and Gaia GUI. Does anyone know how to indicate these variables in the command?&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 06 May 2025 16:36:49 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Cloud-Firewall/Migrate-export-scripting/m-p/248219#M5310</guid>
      <dc:creator>iesnoz</dc:creator>
      <dc:date>2025-05-06T16:36:49Z</dc:date>
    </item>
    <item>
      <title>Re: Migrate export scripting</title>
      <link>https://community.checkpoint.com/t5/Cloud-Firewall/Migrate-export-scripting/m-p/248230#M5311</link>
      <description>&lt;P&gt;&lt;SPAN&gt;When called from cron, the command is executed with sh (Bourne Shell), which does not support shell expansions like&amp;nbsp;$(date +"%d-%m-%Y").&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The fix for this would be to put this command in a bash script, which would be called by cron instead.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 06 May 2025 17:23:10 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Cloud-Firewall/Migrate-export-scripting/m-p/248230#M5311</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2025-05-06T17:23:10Z</dc:date>
    </item>
    <item>
      <title>Re: Migrate export scripting</title>
      <link>https://community.checkpoint.com/t5/Cloud-Firewall/Migrate-export-scripting/m-p/248340#M5312</link>
      <description>&lt;P&gt;Thanks PhoneBoy, I created the bash script (using Gemini as help by the way) and it worked perfectly. If it helps to anybody this is the complete script, including SCP transfer to server and deletion of files older than 15 days:&lt;/P&gt;&lt;P&gt;#!/bin/bash&lt;/P&gt;&lt;P&gt;# variables&lt;BR /&gt;DATE=$(date +%d-%m-%Y)&lt;BR /&gt;RUTA_EXPORT="/var/log/backups"&lt;BR /&gt;FILE_NAME="Export_server_-$DATE.tgz"&lt;BR /&gt;COMPLETE_PATH="$RUTA_EXPORT/$FILE_NAME"&lt;BR /&gt;RUTA_SCRIPT_CP="/opt/CPsuite-R81.20/fw1/scripts/migrate_server"&lt;/P&gt;&lt;P&gt;# SCPCP&lt;BR /&gt;USER_SCP="user"&lt;BR /&gt;SERVER_SCP="1.2.3.4"&lt;BR /&gt;RUTA_REMOTA_SCP="/c:/backups"&lt;BR /&gt;PASSWORD_SCP="password"&lt;/P&gt;&lt;P&gt;# OLD_DAYS&lt;BR /&gt;DAYS_OLD=15&lt;/P&gt;&lt;P&gt;# CP environment&lt;BR /&gt;source /etc/profile.d/CP.sh&lt;/P&gt;&lt;P&gt;# export command&lt;BR /&gt;"$RUTA_SCRIPT_CP" export -v R81.20 --ignore_warnings "$COMPLETE_PATH" -n&lt;/P&gt;&lt;P&gt;# Verificar si la exportación fue exitosa&lt;BR /&gt;if [ $? -eq 0 ]; then&lt;BR /&gt;echo "Exportación del servidor completada exitosamente."&lt;/P&gt;&lt;P&gt;# Enviar el fichero por SCP&lt;BR /&gt;echo "Enviando el fichero $COMPLETE_PATH a $USER_SCP@$SERVER_SCP:$RUTA_REMOTA_SCP..."&lt;BR /&gt;sshpass -p "$PASSWORD_SCP" scp "$COMPLETE_PATH" "$USER_SCP@$SERVER_SCP:$RUTA_REMOTA_SCP"&lt;/P&gt;&lt;P&gt;# Verificar si el envío por SCP fue exitoso&lt;BR /&gt;if [ $? -eq 0 ]; then&lt;BR /&gt;echo "El fichero $FILE_NAME se ha enviado correctamente a $SERVER_SCP:$RUTA_REMOTA_SCP"&lt;/P&gt;&lt;P&gt;# Borrar ficheros antiguos&lt;BR /&gt;echo "Buscando y borrando ficheros con más de $DAYS_OLD días en $RUTA_EXPORT..."&lt;BR /&gt;find "$RUTA_EXPORT" -type f -name "Export_server_*" -mtime +"$DAYS_OLD" -delete&lt;/P&gt;&lt;P&gt;if [ $? -eq 0 ]; then&lt;BR /&gt;echo "Se han borrado los ficheros antiguos exitosamente."&lt;BR /&gt;else&lt;BR /&gt;echo "Advertencia: Podría haber habido problemas al borrar los ficheros antiguos."&lt;BR /&gt;fi&lt;/P&gt;&lt;P&gt;else&lt;BR /&gt;echo "Error al enviar el fichero $FILE_NAME por SCP."&lt;BR /&gt;fi&lt;BR /&gt;else&lt;BR /&gt;echo "Error durante la exportación del servidor."&lt;BR /&gt;fi&lt;/P&gt;&lt;P&gt;exit 0&lt;/P&gt;</description>
      <pubDate>Wed, 07 May 2025 13:24:50 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Cloud-Firewall/Migrate-export-scripting/m-p/248340#M5312</guid>
      <dc:creator>iesnoz</dc:creator>
      <dc:date>2025-05-07T13:24:50Z</dc:date>
    </item>
  </channel>
</rss>

