We will also be importing from Mantis (MySQL) to test the migration process.
Azure VM
- Provision an Azure VM, DS2_V2. We won't be keeping it up 24/7 so price doesn't matter too much. Note: I used Windows 2016 Datacentre
- Create a DNS name <something>.fnzbasakljira.australiasoutheast.cloudapp.azure.com so you never need to look at the IP address (but we do - later).
- Configure network security group to allow ports 80/443. 80 for free SSL, 443 for actual secure use later.
- Log onto VM
- What I always do: Turn off IESC and install the ubiquitous tools - Notepad++, 7-Zip
- In Windows Firewall, add an inbound rule to allow HTTP/S (TCP 80, 443)
JIRA (v7.4.2#74004)
- Download and install JIRA - choose the Express/Demo option
- Use the custom/expert mode
- Follow the steps to create a key for a 90 day trial
- Choose port 80 instead of 8080
SSL
- Create a DNS record to point to the VM's IP address
- Go to https://sslforfree.com and follow the steps to create a certificate
- Use the option for Manual Verification
- On the Azure VM, create the folder structure C:\Program Files\Atlassian\JIRA\well-known\acme-challenge\FeDY-uMBdrY4SWhoTjwCe7XT9lXxv7nKNUW9b_wOUV0 where the last folder name is the name of the file expected, e.g.
- http://my.domain.com/.well-known/acme-challenge/FeDY-uMBdrY4SWhoTjwCe7XT9lXxv7nKNUW9b_wOUV0/
- In the folder, save the file ("Download file #1") from the SSLforFree verification link and rename it as index.htm
- Edit the file C:\Program Files\Atlassian\JIRA\conf\server.xml and add this line before the similar <Context path="" line
- <Context path="/.well-known" docBase="${catalina.home}/well-known" reloadable="false" useHttpOnly="true" />
- Click "Download SSL Certificate"
- Click "Download All SSL Certificate Files" on the next page
- You now have certificate.crt, private.key and ca_bundle.crt
- Download OpenSSL binaries for Windows. I used the slproweb link from https://wiki.openssl.org/index.php/Binaries
- For the next step, easier to copy the 3 files into the same folder as openssl.exe, then delete them after.
- Run the command line (in openssl.exe folder) (you can change the highlighted name):
C:\OpenSSL-Win32\bin>openssl pkcs12 -export -in certificate.crt -inkey private.key -out cert.p12 -name SSLForFree -CAfile ca_bundle.crt -caname root - Then, in the cmd.exe console swith to JIRA's JRE bin folder and run this:
keytool -importkeystore -deststorepass changeit -destkeystore "C:\Program Files\Atlassian\JIRA\jre\lib\security\cacerts" -srckeystore C:\OpenSSL-Win32\bin\cert.p12 -srcstoretype PKCS12 -srcstorepass yourPfxPassword
keytool -storepasswd -new yourPfxPassword -keystore "C:\Program Files\Atlassian\JIRA\jre\lib\security\cacerts"
Using your password from step 12 - In cmd.exe, set the environment variable for Java
SET JRE_HOME=C:\Progra~1\Atlassian\JIRA\jre - Run the JIRA configuration utility
C:\Program Files\Atlassian\JIRA\bin>config.bat - In the Web Server tab, change:
Profile: HTTP and HTTPS (redirect)
HTTPs Port: 443
Keystore Path: C:\Program Files\Atlassian\JIRA\jre\lib\security\cacerts
Keystore Password: yourPfxPassword - Use "Check Certificate in Key Store" button to ensure everything is correct before clicking Save then Close
- As at 2nd August 2017, the JIRA configuration utility puts the wrong connector into the server.xml (see step 6 for path) file when HTTPS is enabled. Look for org.apache.coyote.http11.Http11Protocol and change it to org.apache.coyote.http11.Http11NioProtocol
- Finally, we can use the batch files in C:\Program Files\Atlassian\JIRA to recycle JIRA
stop_service.bat
start_service.bat
MySQL (5.7.19)
- Download an installer package from https://dev.mysql.com/downloads/
- Community Server
- Installer (instead of Zip file)
- Search on Google for "visual studio 2013 c++ redistributables", download and install
- The installer seems to have a provision to locate and install, but it didn't work for me
- We only need the server and command line tools, but I wasn't sure if MySQL Server (only) includes the command line tools, so I used Custom, then chose MySQL Server X64, then ticked only
- MySQL Server
- Client Programs
- Server data files
- Click Next, then Execute
- Choose (where not specified, use defaults, and provide your own root password)
- "Standalone MySQL Server"
- Config Type: Server Machine
- Complete installation
Mantis
- Paste the MySQL dump file into the MySQL bin folder, e.g. C:\Program Files\MySQL\MySQL Server 5.7\bin
- Run MySQL command line from C:\Program Files\MySQL\MySQL Server 5.7\bin>mysql -u root -p
- In MySQL, run the following commands to create a new db and restore from dump (change the file name):
mysql> create database mantis;
mysql> use mantis;
mysql> source dumpfilename.sql; - Note: I had to
Import Mantis to JIRA
- As per https://confluence.atlassian.com/adminjiraserver074/connecting-jira-applications-to-mysql-881683181.html, download the MySQL connector from https://dev.mysql.com/downloads/connector/j/
- Get the mysql-connector-java-5.1.43-bin.jar (any version) from the zip file and paste into C:\Program Files\Atlassian\JIRA\lib
- Stop and start JIRA service
- Use the menu item, Create Project -> Import and follow the steps
No comments:
Post a Comment