SideProjectGuys / invite-manager-bot

A discord bot that tracks invites and much more
https://docs.invitemanager.co/
GNU General Public License v3.0
168 stars 135 forks source link

how to backup my sql files #184

Open kpopdev opened 3 years ago

kpopdev commented 3 years ago

hi sorry if im noob but how can i backup my sql files if i wanted to move to my new vps or pc. or where the sql files and my database saves.

ghost commented 3 years ago

sudo mysqldump -u root -p im_0 > PATH_TO_BACKUP_OF_IM0.sql sudo mysqldump -u root -p im_1 > PATH_TO_BACKUP_OF_IM1.sql

If you used a user other than root while creating the databases, use that instead. The root user doesn't work without sudo. Replace PATH_TO_BACKUP with where you want to save the backups. For example: /home/username/Desktop/

You can later restore those the same way you initialized the databases when setting up the bot. Just use your backup files instead of the .sql files provided in the scripts directory.

kpopdev commented 3 years ago

and how to restore it?when i have new vps @BreezeQS

chaun14 commented 3 years ago

BreezeQS answered you in his message above, You can later restore those the same way you initialized the databases when setting up the bot. Just use your backup files instead of the .sql files provided in the scripts directory.

ghost commented 3 years ago

Yeah. And just in case you break something and need to roll back to a backup, rather than moving to a different place; you can drop the broken databases, create the new ones and import your backup .sql files.