Skip to content

MySQL and SQLite database migration

padre edited this page Oct 27, 2024 · 2 revisions

ColdBits
How to migrate to Cold Development ColdBits (SQLite & MySQL)

This guide will help you migrate your data, whether you're using SQLite or MySQL.

Warning

Follow the steps carefully to ensure a smooth migration.

SQLite Migration Steps

Export the Data:

On your server, execute the following command to export your data:

  • /bits export
  • save the exported data storage.yml
  • locate the storage.yml file created by the export command and save it in a secure location (you will need this later)
  • navigate to your server’s ~/plugins folder
  • install ColdBits
  • download ColdBits.jar
  • drag and drop the file into your server's plugins folder
  • start the server. This will generate a ~./ColdBits folder

Restore the exported data:

  • drag and drop the saved storage.yml file into the new ~/plugins/ColdBits folder

Import the Data:

  • on your server, use the following command to start the import process:
  • /bits import
  • Confirm the import by typing:
  • /bits import confirm

Success!

Note

Your SQLite database has been successfully migrated.


MySQL Migration Steps

Save the MySQL configuration:

Before making any changes, copy the MySQL configuration to config.yml in ~./ColdBits/config/yml.

# Settings for if you want to use MySQL for data management
mysql-settings:

  # Enable MySQL
  # If false, SQLite will be used instead
  # Default: false
  enabled: false

  # MySQL Database Hostname
  # Default: 127.0.0.1
  hostname: 127.0.0.1

  # MySQL Database Port
  # Default: 3306
  port: 3306

  # MySQL Database Name
  # Default: 
  database-name: ''

  # MySQL Database User Name
  # Default: 
  user-name: ''

  # MySQL Database User Password
  # Default: 
  user-password: ''

  # If the database connection should use SSL
  # You should enable this if your database supports SSL
  # Default: false
  use-ssl: false

  # The number of connections to make to the database
  # Default: 3
  connection-pool-size: 3

Install plugin and setup MySQL

  • install ColdBits
  • download ColdBits.jar and place it in your server's ~/plugins folder
  • start the server to generate ~/plugins/ColdBits folder
  • apply the MySQL configuration
  • navigate to ~/plugins/ColdBits/config.yml
  • paste your saved MySQL configuration into the new config.yml under the MySQL section
  • restart the server
  • after saving the config.yml file, restart your server
  • the ColdBits plugin will now connect to your MySQL database

Success!

Note

Your MySQL database has been successfully migrated ColdBits.


Tip

With these steps, you can easily migrate your ColdBits data, whether you're using SQLite or MySQL.