In this article, we will show 2 ways of upgrading AlgoTrader as an example we will use version 6.1.2 and 6.2.0. Please remember to create a backup of your data before you start this process. It's also recommended to upgrade your test and integration environments first.
Upgrade using the installer.
The advantage of this approach is a clear environment with the entire configuration for the new version provided and setup by the installer. It's the best way to upgrade AlgoTrader especially if you don't need to migrate MySQL and InfluxDB databases.
If you do need to migrate your databases and still prefer this approach you need to use dump files for that:
To dump MySQL go to AT installation folder\mysql\bin default path:
C:\Program Files (x86)\Algotrader\Algotrader_6.1.2\mysql\bin
And open e.g. PowerShell there and execute:
.\mysqldump.exe -u root -p algotrader --triggers --port=23306 > dump_file.sql
Enter the password to the DB, after that MySQL dump file will be created.
To dump InfluxDB go to AT installation folder\influxdb default path:
C:\Program Files (x86)\Algotrader\Algotrader_6.1.2\influxdb
And open e.g. PowerShell there and execute:
.\influxd.exe backup -portable -database algotrader -host localhost:8088 .\tmp
InfluxDB dump files will be created in \tmp folder.
Now copy backups for MySQL and InfluxDB to Algotrader folder as Algotrader_6.1.2 and all its content will be removed by uninstaller. As backups are prepared you can remove old AT using uninstaller:
After that, you need to download a new installer:
https://algotrader-installer.s3.amazonaws.com/6.2.0/ATSetup_6.2.0.exe
and install AT, then, you just need to import your strategies to a new IDEA environment and in the pom.xml update algotrader-core version from 6.1.2 to 6.2.0. This might cause compilation problems that need to be resolved, details can be found in release notes.
If you created backup files you can insert your old data into the databases, for required changes check the release notes. MySQL schema will be migrated automatically at the first AT server run. The next steps will guide you through the process of inserting your backed-up data into databases. If you don't need that, you already successfully upgraded your AlgoTrader software.
To insert your transactional data go to the Algotrader folder and execute:
Algotrader_6.2.0\mysql\bin\mysql.exe -u root -p algotrader --port=23306 < .\dump_file.sql
During the next startup of AlgoTrader you will see:
To restore your InfluxDB backup execute:
.\Algotrader_6.2.0\influxdb\influxd.exe restore -portable -db algotrader .\tmp\
you might need to first remove the existing database.
Upgrade using source code.
The advantage of this approach is speed. It's much quicker than the 1st one especially if you need to migrate your transactional data although requires more technical knowledge. Below are two links for the source code of bootstrap app that is used for running AlgoTrader:
https://repo.algotrader.ch/nexus/repository/code-general/latest/algotrader-bootstrap.zip
and examples project that contains our example strategies:
https://repo.algotrader.ch/nexus/repository/code-general/latest/algotrader-examples.zip
Full repo:
https://repo.algotrader.ch/nexus/service/rest/repository/browse/code-general/
Download end extract files in your new workspace folder. Copy also your custom strategies, in the pom.xml update algotrader-core version from 6.1.2 to 6.2.0. Open a new project in IDEA in the new workspace folder and import all maven modules.
When all projects are already imported it's needed to run:
mvn clean install
on each project to download required dependencies.
Run configurations for the server are available in the launch module and for each example strategy in the strategy module. If you have IDEA 2020.2 or newer those run configs will be imported automatically after IDEA restart.
Before you run AlgoTrader, it's recommended to create backup files of MySQL and InfluxDB.
Installer MySQL is running on a different port than the default one from the source code, it's needed to change it to connect to your old database:
dataSource.url = jdbc:mysql://127.0.0.1:23306/algotrader?useSSL=false
During the first startup AT will migrate your transactional data to the new schema. For detailed information of changes check the release notes.
Comments
0 comments
Please sign in to leave a comment.