Backup function

Hi,

Is it possible to make a backup of all settings and restore them later?
Since I want to switch from SQLite database to MariaDB.
Because you can’t just copy the SQLite database to MariaDB. I tried it with many different tools and scripts but none of them worked.

What makes it even harder is that all uploaded files are stored as
base64 in the database and so it gets very big and many programs can’t handle it.

you can use our backup tool sogeBot/backup.js at master · sogebot/sogeBot · GitHub

Thanks for the tip, however I ran into a small error.
It does create the backup successfully, however it cannot restore it. For testing, I also created a completely new bot with a different twitch account and added a few very simple commands only. Then made a backup and restored this and even there it brings the following error:

root@d2bef6de200a:/app# node tools/backup.js restore ./backup
Checking if directory ./backup exists...OK
Processing table alert...OK
Processing table alias....OK
Processing table alias_group...OK
Processing table bets...OK
Processing table cache_games...OK
Processing table cache_titles...OK
Processing table carousel...OK
Processing table checklist...OK
Processing table commands/app/node_modules/typeorm/error/TypeORMError.js:9
        var _this = _super.call(this, message) || this;
                           ^

QueryFailedError: Table 'sb_robotter112.class CommandsResponses extends typeorm_2.BaseEntity {
}' doesn't exist
    at QueryFailedError.TypeORMError [as constructor] (/app/node_modules/typeorm/error/TypeORMError.js:9:28)
    at new QueryFailedError (/app/node_modules/typeorm/error/QueryFailedError.js:13:28)
    at Query.onResult (/app/node_modules/typeorm/driver/mysql/MysqlQueryRunner.js:220:57)
    at Query.execute (/app/node_modules/mysql2/lib/commands/command.js:36:14)
    at PoolConnection.handlePacket (/app/node_modules/mysql2/lib/connection.js:456:32)
    at PacketParser.onPacket (/app/node_modules/mysql2/lib/connection.js:85:12)
    at PacketParser.executeStart (/app/node_modules/mysql2/lib/packet_parser.js:75:16)
    at Socket.<anonymous> (/app/node_modules/mysql2/lib/connection.js:92:25)
    at Socket.emit (node:events:513:28)
    at addChunk (node:internal/streams/readable:315:12) {
  query: 'DELETE FROM `class CommandsResponses extends typeorm_2.BaseEntity {\n' +
    '}` WHERE 1=1',
  parameters: undefined,
  driverError: Error: Table 'sb_robotter112.class CommandsResponses extends typeorm_2.BaseEntity {
  }' doesn't exist
      at Packet.asError (/app/node_modules/mysql2/lib/packets/packet.js:728:17)
      at Query.execute (/app/node_modules/mysql2/lib/commands/command.js:29:26)
      at PoolConnection.handlePacket (/app/node_modules/mysql2/lib/connection.js:456:32)
      at PacketParser.onPacket (/app/node_modules/mysql2/lib/connection.js:85:12)
      at PacketParser.executeStart (/app/node_modules/mysql2/lib/packet_parser.js:75:16)
      at Socket.<anonymous> (/app/node_modules/mysql2/lib/connection.js:92:25)
      at Socket.emit (node:events:513:28)
      at addChunk (node:internal/streams/readable:315:12)
      at readableAddChunk (node:internal/streams/readable:289:9)
      at Socket.Readable.push (node:internal/streams/readable:228:10) {
    code: 'ER_NO_SUCH_TABLE',
    errno: 1146,
    sqlState: '42S02',
    sqlMessage: "Table 'sb_robotter112.class CommandsResponses extends typeorm_2.BaseEntity {\n" +
      "}' doesn't exist",
    sql: 'DELETE FROM `class CommandsResponses extends typeorm_2.BaseEntity {\n' +
      '}` WHERE 1=1'
  },
  code: 'ER_NO_SUCH_TABLE',
  errno: 1146,
  sqlState: '42S02',
  sqlMessage: "Table 'sb_robotter112.class CommandsResponses extends typeorm_2.BaseEntity {\n" +
    "}' doesn't exist",
  sql: 'DELETE FROM `class CommandsResponses extends typeorm_2.BaseEntity {\n' +
    '}` WHERE 1=1'
}

About my setup:
I am using your official Docker Image (sogebot/release:latest) with a standalone MariaDB server ( v10.6.9 on Debian 11), where sb_robotter112 is the name of the MySQL user and database name.

Will check thanks

Should be fixed sogeBot/backup.js at master · sogebot/sogeBot · GitHub

Thank you very much, everything is working now as expected! Great work.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.