Backup Drupal site with tar and phpmyadmin

By Rob, 28 February, 2023

Create a backup of your website files with tar, backup database with phpmyadmin

Step

Create website backup using tar

SSH into your server then use the following format to backup your site folder

 tar -czf bkup.tar.gz foldertobackup

Now download that file from your server. I use ftp to do that

backup database from phpmyadmin

  1. go to phpmyadmin site from cpanel or however you normally get there. 
  2. click on the name of your database on the left
  3. click on the export tab at the top
  4. click go
  5. now move that sql file to the folder location you are keeping your backup(Desktop)

Alternatively you can save your database through the command line like you used tar if you have access to mysqldump with your username

mysqldump -u database_username --password="database_password" --databases database_name1 database_name2  > database_backup_file.sql