Contact
Site: US UK AU |
Nexcess Blog

Getting Started with Drupal 8

March 29, 2019 0 Comments RSS Feed

Getting Started with Drupal 8So you’ve weighed your choices and decided Drupal is the best fit for you!

As discussed in our recent Drupal Vs WordPress Cagematch, it takes a developer skill set to get the most out of Drupal. Even so, it can be worthwhile to explore Drupal and get an idea of what it has to offer. Or, perhaps you’re a developer-in-training looking to dip your toes into the CMS ocean.

This is part 1 of a short series designed to show you the basics of installing, updating, and backing up Drupal 8.

Contents

Installing Drupal 8

Unless you’re a developer, installing Drupal isn’t for the faint of heart. Drupal.org has extensive documentation on how to go about it, but we suggest a simpler alternative, one that involves clicking a button.

Our Drupal cloud solution makes it easy and quick, and we back every account with a 30-day money back guarantee. You can read about our Drupal cloud offering on our website, but the best place to start is our Knowledge Library with How to create Nexcess Cloud accounts.

As noted in that article, you’ll need three things to get started: 1) Client Portal login credentials, 2) your valid credit card, and 3) a registered domain name (if you don’t have one yet, we can help).

When choosing your platform, select Drupal, toggle the Auto-Install, and you’ll be up and running within minutes.

Once installed, you can view your live site by clicking on your secondary domain name from within your Client Portal.

When you visit your site for the first time, you’ll see something like:

Your site is live, albeit in a humble, uncooked state. Now, time update your installation to the latest version! 

Updating Drupal 8

Although we install Drupal 8, it falls to you to update to the most current stable release. We strongly recommend staying current on releases. No content management system (CMS) is immune to exploits, and staying current is the first line of defense against malicious activity.

This entry provides two options for updating your installation: the command line (CLI) or Secure File Transfer Protocol (SFTP).  Both methods require SSH access.

Attention: The Drupal development team recommends Composer for updating purposes, though it requires familiarity with dev-centric language. See the official Drupal documentation for details.

If you’re unfamiliar with the CLI, then SFTP is your best option. Many SFTP applications are available. This document features Cyberduck because it’s free, safe, and relatively easy to use, though many other suitable options are available. For details about how to use it, please see How to transfer files to a server with SFTP.

Take note!

  • This process won’t update any modules or themes. If this is a new installation, this won’t matter now, but it will matter later. Third party extensions require separate updates, and overlooking them exposes your site to possible attack.
  • For anything other than new installs, back up your site before continuing.
  • This process will remove any modifications to files like .htaccess, composer.json, and robots.txt. If and when you’ve modified these files, save them somewhere so you can reapply them post-update.

Step 1: Put Your Site Into Maintenance Mode

  1. Log in to your Drupal admin panel. Click Manage > Configuration > Development.
  2. Select the Put site into maintenance mode check box, then click Save configuration.

Step 2: Remove Old Files

Choose one of the below methods.

Using the CLI

  1. Navigate to your Drupal installation:

    cd /path/to/your/drupal/directory
    
  2. Remove the core and vendor directories:
    rm -rf core vendor
  3. Remove all files in the top-level directory:

    rm -f *.* .[a-z]*

Using SFTP

  1. Select your Drupal directory. In this example, it’s mydrupalsite.com.


  2. Select html.


  3. Delete the core and vendor directories.

Step 3: Download and Extract Update Files

Choose your preferred method below.

Using the CLI

  1. Issue the following, but replace x, y, and z with the updated Drupal version number; for example, /drupal-8-6-13.tar.gz:

    wget https://ftp.drupal.org/files/projects/drupal-x-y-z.tar.gz tar zxf drupal-x.y.z.tar.gz
  2. This command creates a new directory, drupal-x-y-z/, which contains all updated Drupal files and directories.
  3. Change to the new directory, and copy the core and vendor directory and the files in the top-level directory to your Drupal installation directory. As before, replace x, y, and z with the updated Drupal version number:

    cd drupal -x-y-z cp -R core vendor /path/to/your/drupal/directory cp *.* .[a-z]* /path/to/your/drupal/directory

Using SFTP

  1. Download the latest release from the Drupal website to your local device and extract the archive.
  2. Within Cyberduck or another SFTP application, upload the new core and vendor to your Drupal installation by clicking-and-dragging from your local machine to your top-level directory.


  3. As mentioned in the Take note section, this is where you would reapply modifications to your .htaccess, composer.json, or robots.txt files. Since this is a new installation, you may skip this step.

Step 4: Update Database Tables

  1. Verify you are logged in as your site admin.
  2. In your browser, update your core database tables by visiting http://www.example.com/update.php, but replace www.example.com with your domain name.

Step 5: Run Status Report

  1. From your Drupal admin panel, navigate to Manage > Reports > Status report.


  2. Resolve any warnings or errors.

Step 6: Remove Your Site From Maintenance Mode

  1. Return to your Drupal admin panel.
  2. As in Step 1, from your admin panel, click Manage > Configuration > Development > Maintenance Mode, or just click Go online from the green bar notification.
  3. Clear the Put site into maintenance mode check box, then click Save configuration.

Step 7: Clean Up Files (If Necessary)

If you used the CLI method in Step 3: Download and extract files, remove the Drupal release files by issuing the below command. As before, replace x.y.z with the release version number.

rm drupal-x.y.z.tar.gz
rm -rf drupal-x.y.z/ 

Keeping Drupal Up to Date

It is best practice to stay current. There are several ways to stay informed, and we recommend using all of the below methods:

Backing Up Drupal

Backups are your failsafe. If you’re not already in the habit of doing so, we strongly recommend the best practice of making them regularly. As is often the case with Drupal, there are many possible methods. We will focus on two: Drush and the backup_migrate module

Using Drush

For those with developer skills, Drush may offer the most direct method. For details on Drush and additional resources, see the Drupal documentation.

Using the backup_migrate Module

If Drush and the CLI don’t appeal to you, it is possible to add a module that allows you to set up automatic backups.

  1. In your browser, visit https://www.drupal.org/project/backup_migrate/ and download the most current tar.gz of the backup_migrate module to your local device.
  2. From your Drupal admin panel, select Manage > Extend.
  3. Click Install new module.
  4. From the Upload a module or theme archive to install option, click Choose File. Select the tar.gz file you downloaded in Step 1, then click Install.
  5. Click Enable newly added modules.
  6. Scroll to the Other section and select the Backup and Migrate check box. Once again, click Install.
  7. From your Drupal admin panel, navigate to Manage > Configuration > Development > Backup and Migrate.
  8. Though you can perform a manual backup by clicking Backup now, we recommend setting up daily automatic backups. Click the Schedules tab.
  9. In the Daily Schedule row, click Edit. Select the Schedule enabled check box (1), then set Frequency to Run every 1 Days (2). Click Save when ready (3).

Daily backups are now configured! If you are a Nexcess client and relatively new to Drupal, we recommend contacting our support for assistance with restoring your site from a backup.

Next Steps

Continue to Part 2: Navigating Drupal 8, or keep an eye on this space for more about Drupal, including tips about how to create content, administer a team, and other essentials. In the meantime, feel free to experiment with your new site!

  • 2
    Shares
Posted in: Drupal

Tags: