🗃️ Database
🍃 Let's import the old database.
Access to server
Add your ssh key public on server (Ask me for password):
shell
ssh-copy-id -i ~/.ssh/id_rsa.pub debian@sys11.mediamatis.com -p 22
ssh-copy-id -i ~/.ssh/id_rsa.pub debian@sys11.mediamatis.com -p 22
Make a dump of the database from server
Make a dump of the database with the maker command
shell
ssh debian@sys11.mediamatis.com -p 22
cd /var/www/main/docker-leaders
# Make a dump of the database
make dump-database
ssh debian@sys11.mediamatis.com -p 22
cd /var/www/main/docker-leaders
# Make a dump of the database
make dump-database
List databases dump available from local
shell
# List ALL one by line
ssh -t debian@sys11.mediamatis.com "ls -1 /var/www/main/backup-leaders/ && exit"
# List LAST one in TIME
ssh -t debian@sys11.mediamatis.com "ls -t /var/www/main/backup-leaders/ | grep -v /$ | head -n 1 | tail -1 && exit"
# List ALL one by line
ssh -t debian@sys11.mediamatis.com "ls -1 /var/www/main/backup-leaders/ && exit"
# List LAST one in TIME
ssh -t debian@sys11.mediamatis.com "ls -t /var/www/main/backup-leaders/ | grep -v /$ | head -n 1 | tail -1 && exit"
Download dump
Create a folder mkdir backup-leaders
in your PATH_DUMP .env
variable (in project)
shell
# Rsync for downloading dump
rsync -avzP debian@sys11.mediamatis.com:/var/www/main/backup-leaders/[folder_name] /var/www/leadersleague-v2/[folder_name]
# Example:
rsync -avzP debian@sys11.mediamatis.com:/var/www/main/backup-leaders/23-03-24 /var/www/leadersleague-v2/backup-leaders/
# Rsync for downloading dump
rsync -avzP debian@sys11.mediamatis.com:/var/www/main/backup-leaders/[folder_name] /var/www/leadersleague-v2/[folder_name]
# Example:
rsync -avzP debian@sys11.mediamatis.com:/var/www/main/backup-leaders/23-03-24 /var/www/leadersleague-v2/backup-leaders/
Import all new databases
Import all databases .gz
with the maker command
shell
make init-database
make init-database
/!\ OLD /!\ Access to old server /!\ OLD /!\
Add your ssh key public on server (Ask me for password):
shell
ssh-copy-id -i ~/.ssh/id_rsa.pub root@94.23.251.92
ssh-copy-id -i ~/.ssh/id_rsa.pub root@94.23.251.92
/!\ OLD /!\ List databases dump available /!\ OLD /!\
shell
# List ALL one by line
ssh -t root@94.23.251.92 "ls -1 /mnt/disk3-backup/backup/databases/ && exit"
# List LAST one in TIME
ssh -t root@94.23.251.92 "ls -t /mnt/disk3-backup/backup/databases/ | grep -v /$ | head -n 1 | tail -1 && exit"
# List ALL one by line
ssh -t root@94.23.251.92 "ls -1 /mnt/disk3-backup/backup/databases/ && exit"
# List LAST one in TIME
ssh -t root@94.23.251.92 "ls -t /mnt/disk3-backup/backup/databases/ | grep -v /$ | head -n 1 | tail -1 && exit"
Download old dump
Create a folder mkdir backup-leaders
in your PATH_DUMP .env
variable (in project)
shell
# Rsync for downloading dump
rsync -avzP root@94.23.251.92:/mnt/disk3-backup/backup/databases/[folder_name] /var/www/leadersleague-v2/[folder_name]
# Example:
rsync -avzP root@94.23.251.92:/mnt/disk3-backup/backup/databases/24-03-23 /var/www/leadersleague-v2/backup-leaders/
# Rsync for downloading dump
rsync -avzP root@94.23.251.92:/mnt/disk3-backup/backup/databases/[folder_name] /var/www/leadersleague-v2/[folder_name]
# Example:
rsync -avzP root@94.23.251.92:/mnt/disk3-backup/backup/databases/24-03-23 /var/www/leadersleague-v2/backup-leaders/