Turn Your Vehicle Into a Smart Earning Asset

While youโ€™re not driving your car or bike, it can still be working for you. MOTOSHARE helps you earn passive income by connecting your vehicle with trusted renters in your city.

๐Ÿš— You set the rental price
๐Ÿ” Secure bookings with verified renters
๐Ÿ“ Track your vehicle with GPS integration
๐Ÿ’ฐ Start earning within 48 hours

Join as a Partner Today

Itโ€™s simple, safe, and rewarding. Your vehicle. Your rules. Your earnings.

How to migrate artiafactory derby database to mysql database?

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 mysqlCode language: JavaScript (javascript)

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: passwordCode language: PHP (php)

  • 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: artifact123Code language: PHP (php)

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: passwordCode language: JavaScript (javascript)

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/Code language: JavaScript (javascript)

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 *Code language: JavaScript (javascript)

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=28856Code language: PHP (php)

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

Certification Courses

DevOpsSchool has introduced a series of professional certification courses designed to enhance your skills and expertise in cutting-edge technologies and methodologies. Whether you are aiming to excel in development, security, or operations, these certifications provide a comprehensive learning experience. Explore the following programs:

DevOps Certification, SRE Certification, and DevSecOps Certification by DevOpsSchool

Explore our DevOps Certification, SRE Certification, and DevSecOps Certification programs at DevOpsSchool. Gain the expertise needed to excel in your career with hands-on training and globally recognized certifications.