Skip to content

Instantly share code, notes, and snippets.

@mathewjosephh
Created June 25, 2018 07:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mathewjosephh/be88cfff7032a04ccdd9496606382c86 to your computer and use it in GitHub Desktop.
Save mathewjosephh/be88cfff7032a04ccdd9496606382c86 to your computer and use it in GitHub Desktop.
Migration from Acquia Cloud to Local Environment.
- Login to acquia and find out the git url and ssh url
- login to terminal using ssh url
>>ssh sshurl
- find the site aliases existing
>>drush sa
- Follow the process to setup site aliases for drush.
- cd ~./drush
- sudo gedit sitename.aliases.drushrc.php
- save the aliases in the file (sitename).aliases.drushrc.php
- Download all project files
>>cd /var/www/html
>>git clone giturl
>>cd sitefolder
Get all branches details and need to update to right branch
>>git branch -a
>>git pull origin branchname
- Setup database in mysql
>>mysql -u root -p password
>>create database databasename;
>>exit
>>sudo gedit /var/www/html/site/docroot/sites/default/settings.php (for d7)
>>sudo gedit /var/www/html/site/docroot/sites/default/settings/local.settings.php (for d8)
//Update the database host, name, username, password.
- Run Drush command to sync files.
>>drush rsync @project.dev @project.local
- Run Drush command to sync database.
>>drush site-sync @project.dev @project.local
- Clear cache files
>> drush cc all
>> drush cache-clear all
>> drush cache-rebuild
- Somtimes even after drush cache, all cache data will not get executed. So we need to clear cache at drupal table level
For D7
truncate table cache;
truncate table cache_admin_menu;
truncate table cache_block;
truncate table cache_bootstrap;
truncate table cache_features;
truncate table cache_field;
truncate table cache_filter;
truncate table cache_form;
truncate table cache_image;
truncate table cache_libraries;
truncate table cache_menu;
truncate table cache_metatag;
truncate table cache_page;
truncate table cache_panels;
truncate table cache_path;
truncate table cache_rules;
truncate table cache_token;
truncate table cache_update;
truncate table cache_views;
truncate table cache_views_data;
For D8
- Necessary extensions for php installations.
- sudo apt-get install -y php-{bcmath,bz2,intl,gd,mbstring,mcrypt,mysql,zip} && sudo apt-get install libapache2-mod-php -y
sudo apt-get install php7.1-cli php7.1-common php7.1-json php7.1-opcache php7.1-mysql php7.1-mbstring php7.1-mcrypt php7.1-zip php7.1-fpm php7.0-xml
- Need to change path in path(/var/www/html/project/blt/project.yml) (d8)
Change this line: remote: '${project.machine_name}.dev' (this is just example)
- Reset username and password for d8
drush upwd --password="admin" omsadmin
- Drush command to create user
drush user-create libertyadmin --mail="srikanth.mv@genisys-group.com" --password="libertyadmin"
- Drush command to assign role to d8
drush user-add-role "administrator" admin01
- Clear cache using drush
drush cc all
drush cache-clear all
For D8
drush cache-rebuild
Setting up Clean URL and setting up hosts in local environment.
>>sudo gedit /etc/apache2/sites-available/000-default.conf
Add these lines
====================================
<VirtualHost local.site:80>
ServerName www.local.site
ServerAlias local.site
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/site/docroot
ErrorLog ${APACHE_LOG_DIR}/local.site.log
CustomLog ${APACHE_LOG_DIR}/local.site-access.log combined
<Directory /var/www/html/site/docroot>
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
</Directory>
</VirtualHost>
====================================
>>sudo gedit /etc/hosts
Add this line in hosts file
127.0.0.1 local.site
Other php modules needed compulsorily
php-memcached, php7.1-xml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment