Drupal 8 Start – Backing up and Dev Desktop

Needed Links

Downloaded Acquia Dev Desktop for my Windows Laptop. I now have my own local Drupal site. Where should I start learning how to make this site work? – Drupal Org to start

I had to decide whether to use PHP 7 or PHP 5 so I read up on the differences. – PHP 7 is better

I’m installing PHP 7.0.14

It allows for the coalesce operator <=> which returns -1 0 or 1 depending on the operands.

It brings in return types for functions.

function foo(): array {
    return [];
}

Acquia provides a downloadable pdf overview.

Drupal 8 has an in place editor for quickly changing text. This is much better than WordPress which makes you enter info into aa section on the customize pane.

I’m looking into getting a new theme because the base theme is rough. The most popular theme is Bootstrap 3 which bridges Drupal and bootstrap. 

There are two entities Content and Configuration.

Watched this youtube series.

I’m now on the Add Content section in the youtube series, which is lesson 31. I need to get to the understanding Views portion.

Managing Display Structure>Content Type > Manage Display

The date format default is horrible. I like this custom format

l, F jS, Y
Thursday, July 13th, 2017

Now I’m getting into Views and creating new views. They are a lot like creating views in databases where you can select certain elements and have it automatically update.

So I want to create a View of the pins I sell. It is easy to create views that act independently like a black box. They update automatically like a smart playlist. However, getting them to react to the page they are on is a different story. For example on a Pin page, i want to show the other pins made by the same seller. However, there doesn’t seem to be a way to limit the pins shown by creator which needs to be pulled from the current page we’re on. PODS likes to do it using URLs. Drupal may have a bi-directional relationship somewhere.

Create views first, and then make a menu or a page.

To work on the acquia cloud i had to get SSH access in Dev Desktop. Then I had to import my database to a cloned working copy. I replaced the database and then copied all my local files into an empty docroot folder.

There’s something wrong with my git commands. I can’t push to the repo because it doesn’t have a master branch for the Stage. Help on Acquia

Getting the current version.

git log
git log -1

Normally one would avoid including all user files but I want an entire backup on git.

# Ignore configuration files that may contain sensitive information.
sites/*/settings*.php
sites/*/services*.yml

# Ignore paths that contain user-generated content.
sites/*/files
sites/*/private

The test environment for your site on Acquia Cloud is set to deploy the ‘tags/2017-07-14’ branch, and your local Git clone has the ‘tags/2017-07-13’ branch checked out. Do you want to overwrite your local checkout of the ‘tags/2017-07-13’ branch with the ‘tags/2017-07-14’ branch? Yes



I made a new branch, swapped out the files, imported the database, and pushed using Dev desktop. Now it wants me to deploy my newly created branch. And that worked!!!!!

  1. Create a site locally.
  2. Get database backup from migrate
  3. Pull from environment already made.
  4. Create new branch
  5. Checkout that branch
  6. Replace all files from local -drag and drop
  7. Replace database from local – phpmyadmin
  8. Push using Dev Deskop

I broke some image links and I don’t quite know why.

  1. Fresh install of drupal – how do i do this on acquia cloud?
  2. Transfer modules, themes, profile folders
  3. Make sites/default read and writable – chmod 775 default
  4. On new site delete sites/default/files  rm -R sites/default/files
  5. Now transfer the files folder (If you zip them, make chmod 775 files)
  6. give yourself write permissions and edit settings.php sites/default/settings.php chmod 644 settings.php
  7. Add the trusted host patterns to the bottom and the database login information after the example.
 $settings['trusted_host_patterns'] = array(
'^uvacooperdev\.prod\.acquia-sites\.com$',
'^www.\uvacooperdev\.prod\.acquia-sites\.com$',
'^uvacooperstg\.prod\.acquia-sites\.com$',
'^www.\uvacooperstg\.prod\.acquia-sites\.com$',
'^drupal-8-3-5-transfered\.dd$',
'^www.\drupal-8-3-5-transfered\.dd$',
);

 $databases['default']['default'] = array (
 'database' => 'drupal_8_3_5_transfered',
 'username' => 'sqlusername',
 'password' => 'sqlpassword',
 'host' => 'localhost',
 'port' => '3306',
 'driver' => 'mysql',
 'prefix' => '',
 'collation' => 'utf8mb4_general_ci',
 );
  1. Change the permissions back to chmod 444 settings.php

I fucked with a lot of the permissions to get this site to transfer properly. It wasn’t pretty. I think what finally did it was clearing the cache from the devel tap at the top. I also set a default image but I don’t think that did it. CLEAR THE CACHE

Second Attempt at clean transfer down from cloud and back up

  1. Pull from cloud
  2. Make Changes
  3. Check current branch (git branch git reflog)
  4. If not on a branch then make a new branch. Not being on a branch says the HEAD is detached
  5. Add and commit changes to local git repository
  6. Push to cloud using the Dev Desktop push
    1. It will say something about needing to deploy a branch on the environment to see the changes but that’s not true. The changes take effect even though there is not master branch
  7. Clear cache if changes aren’t obvious

 

 

 asd