Slide 1
Most trusted JOB oriented professional program
DevOps Certified Professional (DCP)

Take your first step into the world of DevOps with this course, which will help you to learn about the methodologies and tools used to develop, deploy, and operate high-quality software.

Slide 2
DevOps to DevSecOps – Learn the evolution
DevSecOps Certified Professional (DSOCP)

Learn to automate security into a fast-paced DevOps environment using various open-source tools and scripts.

Slide 2
Get certified in the new tech skill to rule the industry
Site Reliability Engineering (SRE) Certified Professional

A method of measuring and achieving reliability through engineering and operations work – developed by Google to manage services.

Slide 2
Master the art of DevOps
Master in DevOps Engineering (MDE)

Get enrolled for the most advanced and only course in the WORLD which can make you an expert and proficient Architect in DevOps, DevSecOps and Site Reliability Engineering (SRE) principles together.

Slide 2
Gain expertise and certified yourself
Azure DevOps Solutions Expert

Learn about the DevOps services available on Azure and how you can use them to make your workflow more efficient.

Slide 3
Learn and get certified
AWS Certified DevOps Professional

Learn about the DevOps services offered by AWS and how you can use them to make your workflow more efficient.

previous arrow
next arrow

How to migrate artiafactory derby database to mysql database?

Spread the Knowledge

Step 1 – Check mysql version supported by artiafactory 7.x

Artifactory supports MySQL v5.5, 5.6, 5.7 and 8.x with InnoDB engine which is the default provided.

Step 2 – Take a full import of System

System Export from the currently running instance by opening from Artifactory UI -> Admin -> Import & Export -> System. Select the Exclude Content checkbox. By selecting this, we export only the configurations from Artifactory but not the binary data.

Step 3 – Setup a mysql server, database and permission

$ docker run --name mysql8 -v /tmp/database:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=my-secret-pw -e MYSQL_DATABASE=artifactory -e MYSQL_USER=artifactory -e MYSQL_PASSWORD=artifact123 -d mysql

Step 4 – Stop artiafactory server

$ cd /opt/artifactory-pro-7.23.3/app/bin
$ ./artifactory.sh stop

Step 5 – Make databases changes in property file of artiafactory


  • Copy a following section of mysql from system.full-template.yaml
$ more /opt/artifactory-pro-7.23.3/var/etc/system.full-template.yaml

    ## Example for mysql
    ## uncomment below to use database type
    ##type: mysql
    ##driver: com.mysql.jdbc.Driver
    ##url: "jdbc:mysql://<your db url, for example: localhost:3306>/artdb?characterEncoding=UTF-8&elideSetAutoCommits=true&useSSL=false"
    ##username: artifactory
    ##password: password

  • Make a changes in /opt/artifactory-pro-7.23.3/var/etc/system.yaml with following content
   ## Example for mysql
    ## uncomment below to use database type
    type: mysql
    driver: com.mysql.jdbc.Driver
    url: "jdbc:mysql://172.17.0.2:3306/artifactory?characterEncoding=UTF-8&elideSetAutoCommits=true&useSSL=false"
    username: artifactory
    password: artifact123

shared:
  database:
    type: mysql
    driver: com.mysql.jdbc.Driver
    url: jdbc:mysql://<your db url, for example: localhost:3306>/artdb?characterEncoding=UTF-8&elideSetAutoCommits=true&useSSL=false
    username: artifactory
    password: password

Step 6 – Copy a mysql database driver to required location

  • Download the MySQL JDBC driver (available from the MySQL website) and copy the mysql-connector-java-.jar file into $JFROG_HOME/artifactory/var/bootstrap/artifactory/tomcat/lib directory.
$ cd /tmp
$ wget https://cdn.mysql.com//Downloads/Connector-J/mysql-connector-java-8.0.26.tar.gz
$ tar -zxvf mysql-connector-java-8.0.26.tar.gz
$ cp mysql-connector-java-8.0.26.jar /opt/artifactory-pro-7.23.3/var/bootstrap/artifactory/tomcat/lib/

Step 7 – Clean all logs so if errors are there – can be troubleshoot easily

$ cd /opt/artifactory-pro-7.23.3/var/log
$ rm -rf *

Step 8 – Start a artiafactory

$ cd /opt/artifactory-pro-7.23.3/app/bin
$ ./artifactory.sh start

$ ./artifactory.sh status
Using default router's certificate and private key
router is running (PID: 28404)
metadata is running (PID: 28550)
event is running (PID: 28662)
frontend is running (PID: 28778)
Artifactory is running, on pid=28856

Step 9 – Import all the files which we got as part of Step2.

To migrate your existing database:

Import the metadata using Full Import and Export (optional for migration, not required for a new installation). Changing the database does not automatically transfer your data to the new database.

Verify the Migration from Derby to Mysql

Check Artifactory running or not

$ ./artifactory.sh status

Chec a Browsers if its Functioning well or not. Wait 2-3 mins.

Come inside a container

$ docker exec -it 916877c4a82c /bin/bash

Login to mysql using root

$ mysql -h localhost -u root -p

Validate Tables of Artifcatory Migration

show databases;
use artdb;
show tables;
exit

How to troubleshoot?

$ ./artifactory.sh status
$ cd /opt/artifactory-pro-7.23.3/var/log
Check a log for errors.

Reference

https://www.jfrog.com/confluence/display/JFROG/Configuring+the+Database#ConfiguringtheDatabase-ChoosingtheRightDatabase

Rajesh Kumar