Gary's picture

Hello,

We are looking to move a Drupal 8 website from the previous version of the Drupal 8 Turnkey appliance (which was based on Debian Jessie) to the present version of the Drupal 8 Turnkey appliance (which is based on Debian Stretch).  On the present version of the appliance, however, the folder structure of /var/www/drupal8 is different; there is now a "web" subfolder which contains the "core", "modules", "profiles", "sites" and "themes" folders.  Is this because drush is now installed on the present version of the appliance, but was not installed on the previous version of the appliance?

Would the following series of steps cover everything we would need to do to move the website from the previous version of the appliance to the present version of the appliance?

1. Make certain that the MySQL user "drupal8" has the same password on both MySQL installations.

2. Execute "tar pczf [filename] drupal8" while in /var/www/ on the previous version of the appliance in order to make a tar file of the previous appliance version's entire Drupal installation with file ownership and permissions preserved, then remove the /var/www/drupal8 folder on the present version of the appliance, then transfer [filename] to /var/www/ on the present version of the appliance, and then execute "tar xvfz [filename]" while in /var/www/ on the present version of the appliance.

3. Having cleared all of the Drupal's caches on the previous version of the appliance, use the "Backup database" function on the "drupal8" MySQL database on the previous version of the appliance to obtain a .sql file, and then, with the .sql file, use the "Execute SQL" function on the "drupal8" database on the present version of the appliance.

4. In Apache on the present version of the appliance, change the Document Root from "/var/www/drupal8/web/" to "/var/www/drupal8/" on the virtual host on port 80 and on the virtual host on port 443.

5. In /etc/apache2/sites_available/drupal8.conf on the present version of the appliance, change

<Directory /var/www/drupal8/web>
    Options +FollowSymLinks
    AllowOverride All
Require all granted
</Directory>

to have "<Directory /var/www/drupal8/>" as the first line.


Thank you in advance!

Forum: 
Jeremy Davis's picture

Your suggested strategy sounds reasonable to me. Although personally, I would test it out to be 100% sure.

It's possibly also worth noting, that your Drupal version may well need updating too. IIRC the reason why Drush is installed differently in the newer appliance was because there were some major changes caused by a security update some time ago. I recall writing up documentation and testing it out myself. Unfortunately, I can't find that anywhere right now... :(

Regardless, I would suggest that you migrate your site to the newer server first, then update Drupal to a supported version. At the time of writing, the current version is v8.7.6, but you can always see the latest v8.x release, on the Drupal site.

If your site is fairly high traffic, then I would recommend doing a "dry run" first. Document everything as you go, especially any issues you hit. You can leave the current site running whilst you test it out on a new server. Then once you are happy, put the current site into maintenance mode and replay your steps. Then update the DNS to point to your new server and you should be all good. If your site doesn't have much traffic, or you can get away with a bit of downtime, then you may be able to just do it in "one go".

Please don't hesitate to [post back if you have issues and I'll do my best to help out.

Gary's picture

Hi, Jeremy,

Many thanks for the information and suggestions!

Executing the migration procedure I outlined, and then attempting to update Drupal, on the new appliance, to 8.7.6 resulted in the following error:
Drupal\Core\Entity\EntityStorageException: Exception thrown while performing a schema update. Cannot rename tmp_89abdbmenu_link_content_revision to menu_link_content_revision: table menu_link_content_revision already exists. in Drupal\Core\Entity\Sql\SqlContentEntityStorage->wrapSchemaException() (line 1607 of /var/www/drupal8/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).
So, instead, I updated Drupal, on the previous appliance, to 8.7.6, successfully, and then executed the migration procedure that I outlined.

Thankfully, everything seems to work on the new appliance, despite the "old" (i.e. no "/web" folder) folder structure, although we will see what happens the next time we have to do a Drupal version update.

I'm hoping that it's OK, for the future, for us to keep using the "old" Drupal folder structure; I would be interested to read the documentation about the major changes caused by the security update you mentioned.

Thanks again!

Jeremy Davis's picture

If my memory serves me correctly, the reason for the changes in directory layout, were because of changes in the underlaying Symfony framework (FWIW unlike previous Drupal releases which were built from scratch, Drupal 8 is built on the Symfony framework). Here is the blog post regarding the security issue I was thinking of.

So long as you have done the update and are running a current supported version, I imagine that the exact underlaying file structure shouldn't really matter.

Add new comment