KB Article #180651
BACKUP: Backup and Restore for Secure Transport installations with embedded MySQL database
This article will provide instructions for backing-up a SecureTransport instance running with its embedded MySQL database.
Table of contents
The following topics will be covered:
- SecureTransport installed on Linux
- Backup SecureTransport with all MySQL tables and historical logs
- Restore SecureTransport with all MySQL tables and historical logs
- Backup SecureTransport excluding the Server Log and File Tracking-related DB tables, and without the historical logs
- Restore SecureTransport without the Server Log and File Tracking-related DB tables, and without the historical logs
- SecureTransport installed on Windows
- Backup SecureTransport with all MySQL tables and historical logs
- Restore SecureTransport with all MySQL tables and historical logs
- Backup SecureTransport excluding the Server Log and File Tracking-related DB tables, and without the historical logs
- Restore SecureTransport without the Server Log and File Tracking-related DB tables, and without the historical logs
Before executing any of the below steps, you MUST stop all SecureTransport services. Failure to do so will result in a corrupted backup.
IMPORTANT NOTE: The backups created with the below procedures, must be restored on machines with the same IP(s) and hostname and into the original installation folder of your previous SecureTransport installation!
SecureTransport installed on Linux
Prerequisites and considerations
The backup consist of archiving the contents of the Secure Transport directories, preserving the subdirectory structure.
The backup should be taken using the same OS account that ST was installed with (and is running under).
When ST is installed on a VM, another backup mechanism is to take a snapshot of the VM machine, with the ST services stopped. Refer to your virtualization administrator for suggestions.
In case of multiple ST nodes in the cluster, it is recommended that application backup and restore is done for each ST node independently.
Keeping the Server Log, File Tracking and historical logs
Backup SecureTransport with all MySQL tables and historical logs
This type of backup will keep all server and transfer logs, plus any historical file logs. Due to this, the size of the backup can be considerable. Make sure you have sufficient space in the destination directory, where the backup file will be stored.
Stop all ST services
cd $FILEDRIVEHOME
bin/stop_all
Check for leftover processes
ps -ef | grep SecureTransport
If any lefover processes are found, you can kill them manually with kill -9 <PID>
.
Create a tarball of SecureTransport's directory
tar -zcvf /path/to/backup/directory/ST_5.X.X.tar.gz /opt/Axway
Make sure you have sufficient space in /path/to/backup/directory
to accommodate the tarball file.
Restore SecureTransport with all MySQL tables and historical logs
The below steps are valid only if the backup is taken following the steps from Backup SecureTransport with all MySQL tables and historical logs.
On the new server, make sure that you meet the installation prerequisites and install the same ST version in the same location.
Stop all ST services
cd $FILEDRIVEHOME
bin/stop_all
Check for leftover processes
ps -ef | grep SecureTransport
If any lefover processes are found, you can kill them manually with kill -9 <PID>
.
Rename the current installation directory
cd /opt
mv /opt/Axway /opt/Axway_new
Extract the ST tarball
tar -xzvf /path/to/backup/directory/ST_5.X.X.tar.gz -C /
Excluding the Server Log, File Tracking and historical logs
Backup SecureTransport excluding the Server Log and File Tracking-related DB tables, and without the historical logs
This type of backup will exclude all server and transfer logs, and the historical file logs. The resulting backup file will be smaller, but the drawback is that you will lose all existing and historical log activity.
This type of backup is suitable for Backends only. ST Edges should be following the procedure for a full backup above.
In all commands below replace <DBPASSWORD>
with the actual database password.
Stop all ST services
cd $FILEDRIVEHOME
bin/stop_all
Check for leftover processes
ps -ef | grep SecureTransport
If any lefover processes are found, you can kill them manually with kill -9 <PID>
.
Start the DB service only and dump the SecureTransport DB schema
bin/start_db
mysql/bin/mysqldump --defaults-file=conf/mysql.conf -uroot -p<DBPASSWORD> st --no-data > /path/to/backup/directory/schema.sql
Back up the MySQL Database without the large Server Log and File Tracking related tables
For clean install of SecureTransport 5.3.6 and above use:
mysql/bin/mysqldump --defaults-file=conf/mysql.conf --database st -p<DBPASSWORD> --ignore-table=st.logging_event --ignore-table=st.logging_event_exception --ignore-table=st.logging_event_property --ignore-table=st.TransferResubmitData --ignore-table=st.TransferProtocolCommands --ignore-table=st.TransferDetails --ignore-table=st.SubtransmissionStatus --ignore-table=st.TransferData --single-transaction --disable-keys --skip-set-charset > /path/to/backup/directory/clean-db-dump.sql
For older installations upgraded to SecureTransport 5.3.6 (and in case the old File Tracking tables have not been dropped, see KB 178036) use:
mysql/bin/mysqldump --defaults-file=conf/mysql.conf --database st -p<DBPASSWORD> --ignore-table=st.logging_event --ignore-table=st.logging_event_exception --ignore-table=st.logging_event_property --ignore-table=st.TransferStatus --ignore-table=st.TransferResubmitData --ignore-table=st.TransferProtocolCommands --ignore-table=st.TransferDetails --ignore-table=st.SubtransmissionStatus --ignore-table=st.TransferData --single-transaction --disable-keys --skip-set-charset > /path/to/backup/directory/clean-db-dump.sql
Create a SecureTransport backup, excluding the MySQL tables and the exported history logs
bin/stop_db
tar --exclude='/opt/Axway/SecureTransport/var/db/mysql/data/*' --exclude='/opt/Axway/SecureTransport/var/db/hist/*' -zcvf /path/to/backup/directory/ST_5.X.X.tar.gz /opt/Axway
Make sure you have sufficient space in /path/to/backup/directory
to accommodate the tarball file.
Restore SecureTransport without the Server Log and File Tracking-related DB tables, and without the historical logs
The below steps are valid only if the backup is taken following the steps from Backup SecureTransport excluding the Server Log and File Tracking-related DB tables, and without the historical logs.
In all commands below replace <DBPASSWORD>
with the actual database password.
On the new server, make sure that you meet the installation prerequisites and install the same ST version in the same location.
Stop all ST services
cd $FILEDRIVEHOME
bin/stop_all
Check for leftover processes
ps -ef | grep SecureTransport
If any lefover processes are found, you can kill them manually with kill -9 <PID>
.
Start the DB service only and drop the current ST database
bin/start_db
mysql/bin/mysql --defaults-file=conf/mysql.conf -p<DBPASSWORD>
DROP DATABASE st;
bin/stop_db
Additional step ONLY for AIX environments
Remove all ib*
files
cd var/db/mysql/data
rm ib*
Move the MySQL data to another location
cd $FILEDRIVEHOME
mv var/db/mysql/data /tmp/data_without_st
Rename the current installation directory
cd /opt
mv /opt/Axway /opt/Axway_new
Extract the ST tarball
tar -xzvf /path/to/backup/directory/ST_5.X.X.tar.gz -C /
Move back the MySQL data to the SecureTransport installation folder
cd $FILEDRIVEHOME
mv /tmp/data_without_st/* var/db/mysql/data/
Start the DB service and wait for a while, until it throws an error
bin/start_db
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown database 'st'
Login to MySQL and create the DB
mysql/bin/mysql --defaults-file=conf/mysql.conf -p<DBPASSWORD>
CREATE DATABASE st;
exit
Import the database schema and the clean database file
mysql/bin/mysql --defaults-file=conf/mysql.conf -p<DBPASSWORD> st < /path/to/backup/directory/schema.sql
mysql/bin/mysql --defaults-file=conf/mysql.conf -p<DBPASSWORD> st < /path/to/backup/directory/clean-db-dump.sql
Stop the DB service and start all ST services
bin/stop_db
bin/start_all
SecureTransport installed on Windows
Prerequisites and considerations
The backup consist of archiving the contents of the Secure Transport directories, preserving the subdirectory structure.
When ST is installed on a VM, another backup mechanism is to take a snapshot of the VM machine, with the ST services stopped. Refer to your virtualization administrator for suggestions.
In case of multiple ST nodes in the cluster, it is recommended that application backup and restore is done for each ST node independently.
To create and restore the archive the 7zip tool will be used which needs to be installed separately.
Some of the commands listed in the below steps are to be executed from the Cygwin shell. Refer to KB 178648 for information on how to launch and use the Cygwin shell.
Make sure that no folder in $FILEDRIVEHOME
or $FILEDRIVEHOME\..\cygwin
is in use or open in Windows Explorer or in a command window and that no file in those folders is in use or open in any application. Close Windows Explorer and any other application accessing the folders in question. Make sure no SecureTransport services, including Cygwin, are running.
Keeping the Server Log, File Tracking and historical logs
Backup SecureTransport with all MySQL tables and historical logs
This type of backup will keep all server and transfer logs, plus any historical file logs. Due to this, the size of the backup can be considerable. Make sure you have sufficient space in the destination directory, where the backup file will be stored.
Stop all the SecureTransport services with $FILEDRIVEHOME\bin\stop_all
.
You can also open CMD as an administrator and simply run stop_all
.
Verify all services are stopped by checking for running processes and looking for .pid files in the $FILEDRIVEHOME/var/run
directory (there should not be leftover .pid files there). Being extra cautious, in the rare case where there are no .pid files but some processes still remained active, you can examine the process tree with the appropriate OS tools for running processes before proceeding further.
Back up the Windows registry entries. Run regedit.exe
.
Select each of the following registry entries:
HKEY_LOCAL_MACHINE\SOFTWARE\Axway Software HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Axway_Installer_4.8.0 SecureTransport01 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\cygwin_cron HKEY_LOCAL_MACHINE\SOFTWARE\Tumbleweed HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Cygnus Solutions HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\AxwaySecureTransport*
where AxwaySecureTransport* represents all the registry entries that start with "AxwaySecureTransport".
Right click each entry, select Export → Export Registry File, and save the registry entry to a safe location.
When you are finished backing up the registry entries, exit regedit.
Back up the files of the existing SecureTransport installation by copying the contents of the following directories, preserving the subdirectory structure, to a ZIP file or some other achrive type.
- The Axway Installer directory (for example:
C:\Axway\
) - The SecureTransport home directory (this is required when the SecureTransport directory is outside of the Axway Installer directory from the previous point)
Move the archives to a safe location (or multiple) outside the ST host server as best practice
Restore SecureTransport with all MySQL tables and historical logs
The below steps are valid only if the backup is taken following the steps from Backup SecureTransport with all MySQL tables and historical logs.
On the new server, make sure that you meet the installation prerequisites and install the same ST version in the same location.
Stop all the SecureTransport services with $FILEDRIVEHOME\bin\stop_all
.
You can also open CMD as an administrator and simply run stop_all
.
Stop the Cygwin Cron service from the Services page in Microsoft Windows (services.msc
) or execute the below command and close the Cygwin shell:
sc stop cygwin_cron
Move or delete the current Axway Installer directory and Secure Transport home directory.
Extract the backup archive files into the original folders of your previous SecureTransport installation.
Run regedit.exe
and delete the following registry entries:
HKEY_LOCAL_MACHINE\SOFTWARE\Axway Software HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Axway_Installer_4.8.0 SecureTransport01 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\AxwaySecureTransport*
where AxwaySecureTransport* represents all the registry entries that start with "AxwaySecureTransport".
Restore the registry entries that you backed up. To import a registry entry into the Windows registry, double-click the name of the respective .reg
files you saved when you backed up your installation.
Start Cygwin Cron service from the Services page in Microsoft Windows (services.msc
) or execute the below command and from CMD started as Administrator:
sc start cygwin_cron
Reboot your system.
If some of the ST services are not added and registry keys are not created for them, for example, service for AS2 or PeSIT protocol, you can start at least the Admin service, just enable them from the Admin UI → Operations → Server Control page and try to add them again using install_*_service.com
scripts located in the $FILEDRIVEHOME\bin
folder.
Excluding the Server Log, File Tracking and historical logs
Backup SecureTransport excluding the Server Log and File Tracking-related DB tables, and without the historical logs
This type of backup will exclude all server and transfer logs, and the historical file logs. The resulting backup file will be smaller, but the drawback is that you will lose all existing and historical log activity.
This type of backup is suitable for Backends only. ST Edges should be following the procedure for a full backup above.
In all commands below replace <DBPASSWORD>
with the actual database password.
Start the Cygwin shell. All commands below are to be executed in the Cygwin console, unless otherwise stated.
Stop the ST services, and then start the database service only
cd $FILEDRIVEHOME
bin/stop_all
bin/start_db
Back up the database schema
mysql/bin/mysqldump --defaults-file=conf/mysql.conf -uroot -p<DBPASSWORD> st --no-data > /tmp/schema.sql
Back up the database without the large Server Log and File Tracking tables
For clean install of SecureTransport 5.3.6 and above use:
mysql/bin/mysqldump --defaults-file=conf/mysql.conf --database st -p<DBPASSWORD> --ignore-table=st.logging_event --ignore-table=st.logging_event_exception --ignore-table=st.logging_event_property --ignore-table=st.TransferResubmitData --ignore-table=st.TransferProtocolCommands --ignore-table=st.TransferDetails --ignore-table=st.SubtransmissionStatus --ignore-table=st.TransferData --single-transaction --disable-keys --skip-set-charset > /tmp/clean-db-dump.sql
For older installations upgraded to SecureTransport 5.3.6 (and in case the old File Tracking tables have not been dropped, see KB 178036) use:
mysql/bin/mysqldump --defaults-file=conf/mysql.conf --database st -p<DBPASSWORD> --ignore-table=st.logging_event --ignore-table=st.logging_event_exception --ignore-table=st.logging_event_property --ignore-table=st.TransferStatus --ignore-table=st.TransferResubmitData --ignore-table=st.TransferProtocolCommands --ignore-table=st.TransferDetails --ignore-table=st.SubtransmissionStatus --ignore-table=st.TransferData --single-transaction --disable-keys --skip-set-charset > /tmp/clean-db-dump.sql
The backup .sql
files will be created in the tmp
folder under the Cygwin directory, for example, C:\Axway\SecureTransport\cygwin\tmp
Stop all SecureTransport services and the Cygwin Cron service
cd $FILEDRIVEHOME
bin/stop_all
sc stop cygwin_cron
Exit from the Cygwin shell
exit
Create an archive of the Axway Installer folder excluding the MySQL data and the historical logs, using the 7zip tool. Execute the below command in CMD from the 7zip installation folder:
7z.exe -spf a c:\st_archive.zip c:\Axway -x!c:\Axway\SecureTransport\STServer\var\db\mysql\data -x!c:\Axway\SecureTransport\STServer\var\db\hist\logs -mx1
Back up the Windows registry entries. Run regedit.exe
.
Select each of the following registry entries:
HKEY_LOCAL_MACHINE\SOFTWARE\Axway Software HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Axway_Installer_4.8.0 SecureTransport01 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\cygwin_cron HKEY_LOCAL_MACHINE\SOFTWARE\Tumbleweed HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Cygnus Solutions HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\AxwaySecureTransport*
where AxwaySecureTransport* represents all the registry entries that start with "AxwaySecureTransport".
Right click each entry, select Export → Export Registry File, and save the registry entry to a safe location.
When you are finished backing up the registry entries, exit regedit.
Restore SecureTransport without the Server Log and File Tracking-related DB tables, and without the historical logs
The below steps are valid only if the backup is taken following the steps from Backup SecureTransport excluding the Server Log and File Tracking-related DB tables, and without the historical logs.
On the new server, make sure that you meet the installation prerequisites and install the same ST version in the same location.
Start the Cygwin shell. All commands below are to be executed in the Cygwin console, unless otherwise stated.
Stop the ST services, and then start the database service only
cd $FILEDRIVEHOME
bin/stop_all
bin/start_db
Connect to MySQL and drop the current ST database
mysql/bin/mysql --defaults-file=conf/mysql.conf -p<DBPASSWORD>
DROP DATABASE st;
exit
Stop the DB service
bin/stop_db
Stop the Cygwin Cron service from the Services page in Microsoft Windows (services.msc
) or execute the below command and close the Cygwin shell:
sc stop cygwin_cron
Rename the current Axway Installation folder from C:\Axway to C:\Axway_new_installation.
rename c:\Axway Axway_new_installation
Place the st_archive.zip
backup file in c:\
drive and extract the archive using the 7zip command-line utility, executed in CMD from the 7zip's installation folder.
7z.exe -spf x c:\st_archive.zip -oc:\Axway c:\Axway
Navigate to C:\Axway_new_installation\SecureTransport\STServer\var\db\mysql\data
and copy the content to C:\Axway\SecureTransport\STServer\var\db\mysql\data
. This can be done with the xcopy
Windows command, executed from CMD:
xcopy /e/r/y/i/k C:\Axway_new_installation\SecureTransport\STServer\var\db\mysql\data c:\Axway\SecureTransport\STServer\var\db\mysql\data
Open the Cygwin shell again and start the ST's DB service only
cd $FILEDRIVEHOME
bin/start_db
Login to MySQL and create the database
mysql/bin/mysql --defaults-file=conf/mysql.conf -p<DBPASSWORD>
CREATE DATABASE st;
еxit
Import the database schema and the clean database file
mysql/bin/mysql --defaults-file=conf/mysql.conf -p<DBPASSWORD> st < /tmp/schema.sql
mysql/bin/mysql --defaults-file=conf/mysql.conf -p<DBPASSWORD> st < /tmp/clean-db-dump.sql
Reboot your system.