You are here

Export Database to File
So today I wanted to learn how to export a Drupal database to a file quickly. Back in the day I would've logged in through cPanel and navigated to PHPMyAdmin, then manually select an export of the database and have to choose where to save the file. Not to mention all the previous steps listed would need to be preceeded by a Drupal cache flush (I don't like the cache inside a database backup). Typically this would've taken me about 5 minutes to complete, well my friends, no longer is that the case. Behold the power of Drush (once you are ssh'd in and navigated to your drupal root directory)
Drupal 6 and 7
drush cc
drush sql-dump > ~/my-sql-dump-file-name.sql
Drupal 8
drush cr
drush sql-dump > ~/my-sql-dump-file-name.sql
Those two commands clear all the Drupal caches and then dump the sql database to a file in your home directory. Awesome sauce!
Download Database (optional)
If the sql dump file is on a remote server, you can use this terminal command to download a copy of the sql file:
scp tyler@example.com:~/my-sql-dump-file-name.sql ~/Desktop/
Import Database
You can use this command to import the sql dump back into your drupal database.
drush sql-drop
drush sql-cli < ~/my-sql-dump-file-name.sql
A Drush-Less Approach
If you don't have Drush setup (which you should have setup if you want to be cool), you can check out this article to make a backup copy of your Drupal's MySQL database from a terminal: Drupal - How to Make a Backup Copy of MySQL Database
Virgie (not verified) - Sun, 09/17/2017 - 03:30
je prend cialis
cialis online
cialis duration of effects
[url=http://cialislex.com/]cialis generic[/url]
compare viagra and cialis dosages
Jane (not verified) - Sun, 10/22/2017 - 17:45
payday loans no credit check
payday loans no credit check
payday advance
paydayloans
Buford (not verified) - Thu, 11/30/2017 - 05:31
casino games
online slots
casino games
best online casino
Arturo (not verified) - Tue, 12/19/2017 - 17:09
payday loans online direct lenders
best fast loans online
loans online application
payday loans no credit check
Jacob (not verified) - Fri, 12/22/2017 - 02:44
casino games
casino online usa
casino online usa
casino online
online casino real money
Kurt (not verified) - Sun, 02/04/2018 - 03:47
weight loss
weight loss pills garcinia cambogia
weight loss plans
diet pills that really work
Franchesca (not verified) - Tue, 02/13/2018 - 22:43
casino online application
casino games free
casino online application
casino online subtitrat
Bridget (not verified) - Tue, 02/13/2018 - 23:10
casino online usa
casino online subtitrat
best us casinos online
casino g
Lorrie (not verified) - Wed, 02/14/2018 - 21:41
auto insurance quotes
car insurance
car insurance companies
cheap car insurance quotes comparison
Rita (not verified) - Sat, 02/17/2018 - 21:44
casino games real money
casino online for fun
best us casinos online
online casinos 2016
Declan (not verified) - Tue, 02/27/2018 - 02:01
casino online usa
casino games real money
casino games
new usa online casinos 2017
Terese (not verified) - Tue, 03/06/2018 - 04:30
new usa online casinos 2017
casino online subtitrat
online casinos 2016
casino games free
Renate (not verified) - Fri, 03/16/2018 - 01:17
casino online subtitrat
online casino slots
online casino
play casino games online
Linette (not verified) - Fri, 03/16/2018 - 01:47
casino online free
casino games roulette
casino online free
casino online subtitrat
Cindy (not verified) - Thu, 04/12/2018 - 11:50
best us casinos online
play casino games online
casino games list
casinos online
Ted (not verified) - Thu, 03/22/2018 - 01:31
best online casino games free
casino games free online
casino g
play casinos
Camille (not verified) - Sat, 03/24/2018 - 22:03
casino games list
play casino games online
new usa online casinos
new usa online casinos 2017
Jamal (not verified) - Mon, 03/26/2018 - 13:07
casino online usa
online casinos 2016
online casino real money
casino online usa
Dominick (not verified) - Fri, 04/06/2018 - 17:42
casino games free
top rated free online casino games
casino online subtitrat
casino games slots
Deloris (not verified) - Thu, 04/12/2018 - 12:40
casino games real money
casino games list
casinos online
casino online gambling
Roland (not verified) - Mon, 04/09/2018 - 08:59
best online casino games free
casino online subtitrat
online casino
new usa online casinos
Jorg (not verified) - Wed, 03/28/2018 - 20:09
casino games list
casino online gambling
play casinos
casino online usa
Casimira (not verified) - Thu, 04/12/2018 - 11:37
new usa online casinos
casino games list
free casino games and poker
vegas casino games
Ivey (not verified) - Sun, 03/18/2018 - 22:14
casino games free online
casinos online
play casino games online
free casino games and poker
Benjamin (not verified) - Tue, 03/06/2018 - 00:03
casino online free
casino games free online
casino games real money
online casino slots
Mariam (not verified) - Thu, 03/08/2018 - 05:38
casino games
online casino real money
casino games list
casino games roulette
Genie (not verified) - Tue, 04/03/2018 - 09:01
new usa online casinos
pogo casino slots
casino games roulette
play casinos
Audry (not verified) - Thu, 04/12/2018 - 14:35
casino g
casino online usa
casinos online
free casino games and poker
Joeann (not verified) - Sat, 03/10/2018 - 19:38
cheap auto insurance
cheap car insurance quotes california
car insurance quotes comparison online
car insurance quotes allstate
Karissa (not verified) - Mon, 03/12/2018 - 17:45
payday loans definition
fast quick loans online
online loans direct lenders
payday loans no credit check
Kimber (not verified) - Tue, 03/13/2018 - 22:11
casino online for fun
new usa online casinos
best us casinos online
play casino games online
Lynette (not verified) - Sat, 03/31/2018 - 22:27
casino games real money
online casino
play casino games online
slot game
online casino real money
Abbie (not verified) - Tue, 04/03/2018 - 05:25
casino games
vegas casino games
play casinos
casino online application
Ignacio (not verified) - Fri, 03/30/2018 - 19:28
car insurance companies
cheap car insurance online
car insurance quotes comparison
cheap car insurance
Marita (not verified) - Sun, 03/18/2018 - 18:59
online casino slots
casino g
online casino slots
casinos online
Alexandria (not verified) - Sun, 03/18/2018 - 20:03
casino games free
casino games roulette
casino games roulette
casino games slots
Corinne (not verified) - Mon, 03/26/2018 - 12:32
play casino games online
casino games slots
casino online gambling
new usa online casinos 2017
Hudson (not verified) - Mon, 03/26/2018 - 15:25
casino games free
new usa online casinos 2017
casino games free
casino online free
Maurice (not verified) - Sat, 03/31/2018 - 00:10
car insurance quotes comparison
car insurance policy
cheap auto insurance quotes online
car insurance companies
Williemae (not verified) - Fri, 04/06/2018 - 17:12
new usa online casinos 2017
vegas casino games
online casino
casino online subtitrat
Maddison (not verified) - Sun, 04/08/2018 - 19:54
casino online
casino games list
casino online for fun
casino games
Del (not verified) - Sun, 04/15/2018 - 22:58
new usa online casinos 2017
casino games list
casino online
free casino games and poker
Judy (not verified) - Sun, 04/08/2018 - 19:58
casino games slots
casino games real money
casino games
casino g
Kristina (not verified) - Sun, 04/08/2018 - 20:01
casino online subtitrat
vegas casino games
best online casino games free
online casino
Nathan (not verified) - Mon, 04/09/2018 - 06:16
casino games free online
casino online subtitrat
top rated free online casino games
casino games free
Glenn (not verified) - Sun, 04/01/2018 - 14:26
payday loans online bad credit
payday loans bad credit
payday loans online application
payday personal loan
Paulina (not verified) - Tue, 04/03/2018 - 08:18
casino online gambling
best us casinos online
casino games real money
vegas casino games
Lucinda (not verified) - Sun, 04/01/2018 - 20:19
best fast loans online
payday loans bad credit
payday loans definition
loans online no credit check
Louella (not verified) - Fri, 04/06/2018 - 18:21
pogo casino slots
best online casino games free
casino online free
online casinos 2016
Jerrold (not verified) - Tue, 04/10/2018 - 11:23
casino games roulette
casino online gambling
casinos online
new usa online casinos 2017
Pages