---
description: >-
  Documentation on how to migrate database to new format which was introduced in
  v1.2.8.
---

# v1.2.8 Migration

{% hint style="danger" %}
**This is only for those updating bot from versions earlier than 1.2.8, if you've purchased bot when 1.2.8 was already released, skip this page.**

**Make sure to have backup of your** `json.sqlite` **file in case something goes wrong.**
{% endhint %}

{% hint style="danger" %}
This is only needed to be done just once for the first startup after you updated all the files.
{% endhint %}

Version **1.2.8** introduced the option to choose between **3 different database types**. With this feature, the new format for storing data was required for a many reasons, but beside all those reasons, it was obvious that the new, more organised system, was needed.

I tried to make this transition as smooth as possible so for that reason I made `database-actions` addon which simplifies this process **a lot.**

After updating files, make sure to reinstall modules with `npm install` or just starting the bot depending on where you host bot.

To migrate data to new format you need to follow these steps:

1. Stop the bot and make sure you have a backup of `json.sqlite` file
2. [Download addon from this page](database-actions-addon) and move folder from the zip into the `addons` folder
3. Open `config.yml` from that folder and change `startup_migrate` to `true`
4. Start the bot from your panel or command line and **stay in console** so you can see all the output - [you should see this message after a few seconds](https://i.imgur.com/2ViNN3H.png)\
   1\. If you're usually starting bot with **pm2**, don't do for the first time until you migrate to new format, start it with `node index.js` and after everything is done, you can start with **pm2** like usual
5. Migration should start after 15 seconds and you'll be spammed with [a lot of messages like these](https://i.imgur.com/GY8Unnb.png)
6. After migration is done, you should [see this message](https://i.imgur.com/6cWuFDN.png), wait for a 5-6 seconds and stop the bot
7. Remove the addon from `addons` folder and restart the bot unless you want to [Transfer Data to other Database Type](switch-db-type), in that case leave the addon in folder

That's it! 🎉

{% hint style="warning" %}
If some of your data is missing or not transferred, open a Support Ticket so we can find & resolve the problem.
{% endhint %}
