asanchez75

drupal/drush/dump/restore

Feb 28th, 2015
324
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. 1. Put inside file /home/mylinuxuser/.drush/drushrc.php
  2. $command_specific['site-install'] = array('db-su' => 'mysqluser', 'db-su-pw' => 'xxpasswordxx');
  3. 2. drush dl drupal
  4. 3. cd drupal
  5. 4. drush site-install minimal --db-url=mysql://mysqluser:xxpasswordxx@localhost/mydb
  6. or
  7. drush site-install standard --db-url=mysql://mysqluser:xxpasswordxx@localhost/mydb
  8.  
  9. LINK
  10. https://www.drupal.org/documentation/install/developers
  11.  
  12. ==================================================================================================================
  13.  
  14. Using drush to backup and restore a drupal installation
  15.  
  16. 1) Remote server
  17. Inside your drupal installation
  18. $> drush archive-dump
  19. Archive saved to /root/drush-backups/archive-dump/20150228093558/mysite.20150228_093559.tar.gz [ok]
  20. /root/drush-backups/archive-dump/20150228093558/mysite.20150228_093559.tar.gz
  21.  
  22. 2) local server
  23. 1. go to mysql console and set up the same mysql credentials you had for your mysql drupal database
  24.  
  25. mysql> create user 'myuser'@localhost identified by 'xxpasswordxx';
  26. mysql> grant all privileges on *.* to 'myuser'@'localhost';
  27. mysql> set password for 'myuser'@'localhost'=password('xxnewpasswordxx');
  28.  
  29. 2. restore
  30. go to /var/www/html and run
  31.  
  32. $> drush archive-restore mysite.20150228_093559.tar.gz
Add Comment
Please, Sign In to add comment