Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to backup my sql files #184

Open
kpopdev opened this issue Sep 29, 2020 · 4 comments
Open

how to backup my sql files #184

kpopdev opened this issue Sep 29, 2020 · 4 comments

Comments

@kpopdev
Copy link

kpopdev commented Sep 29, 2020

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
Copy link

ghost commented Sep 30, 2020

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
Copy link
Author

kpopdev commented Oct 1, 2020

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

@chaun14
Copy link

chaun14 commented Oct 1, 2020

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
Copy link

ghost commented Oct 1, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants