Getting your site ready to start

Currently our HR website is hosted in Aegir but not central Aegir; this keeps us from using the new cool docker backups.

The easiest way is to grab a backup of any site(I’ll use status2.uoregon.edu in this example)
screenshot107

Since we have an aegir setup with a platform currently I’m going to do as little work as possible.

I export our current database:

mysqldump ourhrdb > database.sql

Then replace the database.sql file in the tar.

We also had to change the password, user, and database in our site drushrc.php to be “drupal” then localhost for the host.

I then replace the platform directory with ours and do a simple find replace in the vhost for the following:
is-prod-uovanilla-7.37-1.0 >
status2.uoregon.edu > hr.uoregon.edu (this is our site name)

Now that our tar is in good shape rename the tar name URI portion to be hr.uoregon.edu we run the drupal_docker as demonstrated to spin up our current site.

If your css and js aren’t working

For whatever reason the css and js aggregation was enabled on our site and not working at all after we did this. If that happens to you these drush commands will fix that for you.(You can run these by pressing 7 and dropping into your shell)

drush vset preprocess_js 0 --yes
drush vset preprocess_css 0 --yes
drush cc all

will now show your pretty site.

Starting the upgrade

All future commands are run in docker, if you dislike something you did during this or screwed something up simply exit the docker terminal if you have it open and type “Q” to close and remove the docker and start over.

We use the fabulous drupal_sup module to do this for us. At the time of writing this module is version is 7.x-2.0-beta2.

cd && drush dl drush_sup && cd -

The following is a set of commands that I used to generate a couple alias files where they needed to go inside the docker instance. You can see about what your alias file should be to modify the next bit of bash to fit you with this drush site alias command:

drush site-alias @self --full --with-optional
drush dl drush_sup-7.x-2.0-beta2

tee /root/.drush/self.alias.drushrc.php<<EOF
<?php
\$aliases['self'] = array (
  'root' => '/var/www/html/hr.uoregon.edu/hrpub-drupal-6.25-hr2-summercamp',
  'uri' => 'http://hr.uoregon.edu',
  'db_url' => 'mysql://drupal:drupal@localhost/drupal',
);
?>
EOF
tee /root/.drush/new.alias.drushrc.php<<EOF
<?php
\$aliases['new'] = array (
  'root' => '/var/www/html/hr.uoregon.edu/hrpub-drupal-6.25-hr2-summercamp2',
  'uri' => 'http://hr.uoregon.edu',
  'db_url' => 'mysql://drupal:drupal@localhost/drupal2',
);
?>
EOF

There is one last thing to prep for our migration:
in sites/all/drush/drushrc.php add the following. (this can be done through the docker terminal or in your favorite editor in the extracted directory.

<?php
$options['strict'] = FALSE;
$command_specific['pm-disable'] = array('strict' => 0);
?>

Let’s make sure drush’s cache is cleared while we are at it:

drush cache-clear drush

We now have two alias files and drush site-upgrade installed.

The rest of this upgrade process is kind of on a site-per site basis.

Here is a little preview of what it looks like. The answer should be “do it automatically” for most if not all steps.

To begin the upgrade we use our two aliases:

drush @self sup @new

screenshot108
screenshot109

This process can take a while but when it’s finally complete you will have a new directory and an upgraded database of your site. The new directory is whatever you put as your alias file. We just need to move some directories. Basically I am moving our new platform to the old location and then making sure our site is the default site along with our drush resets that may or may not be necessary.

mv hrpub-drupal-6.25-hr2-summercamp hrpub-drupal-6.25-hr2-summercamp_old
mv hrpub-drupal-6.25-hr2-summercamp2 mv hrpub-drupal-6.25-hr2-summercamp
ln -s /var/www/html/hr.uoregon.edu/hrpub-drupal-6.25-hr2-summercamp/sites/hr.uoregon.edu /var/www/html/hr.uoregon.edu/hrpub-drupal-6.25-hr2-summercamp/sites/default
drush cc all && drush rr && drush updb

When the script asked me to throw in a new theme during setup I did so, then I went and enabled cosmic in the admin and whala:
screenshot111

One majorly broken but upgraded D7 site.