Grassroots Economic Organizing (GEO) Collective's main website. As a Drutopia project we hope others can learn from and emulate, this project is public. https://geo.coop
Find a file
2019-09-02 08:47:24 -06:00
.ddev Commit all the ddev commands and home additions that are now there 2019-08-08 17:35:33 -04:00
.gitlab/issue_templates Add issue templates 2019-08-20 10:51:19 -06:00
config/sync Restore 'exclude node title' permission 2019-09-02 08:47:24 -06:00
drush/sites Add live drush alias 2019-07-29 08:08:52 -04:00
patches Remove the drutopia default content 2019-07-18 15:40:57 -05:00
scripts Attempt to prevent article term fixes from changing the updated time of all our articles 2019-08-31 10:05:07 -04:00
web Commit compiled CSS 2019-08-31 11:42:48 -04:00
.gitignore Ignore services file 2019-07-28 15:18:13 -04:00
.gitlab-ci.yml Add call to hosting for deploy 2019-08-30 23:54:38 -04:00
7to8fieldmapping.md Document change made in migration plan 2019-08-01 22:59:30 -04:00
composer.json Cannot have multiple slashes for composer name 2019-08-30 21:33:12 -04:00
composer.lock Composer lock with the migrate csv plugin module 2019-08-30 19:27:59 -05:00
ddev_drush_settings.php I think this is safe to commit across environments 2019-07-18 23:27:24 -04:00
DEVELOPMENT.md Link to what started this train of thought 2019-08-14 23:53:37 -04:00
README.md Correct articles script name for migration 2019-08-30 23:54:38 -04:00

GEO.coop README

This project is based on Drutopia, which means it is compatible with existing and future Drutopia features. We will be diverging from Drutopia for special functionality, however.

Getting started

One time:

git clone git@gitlab.com:agaric/sites/geo.git
cd geo

Install DDEV for the following steps to work.

Whenever you want a fresh start:

git pull
ddev start
ddev composer update
ddev . drush -y site:install minimal --existing-config

Note: If you receive a Permission denied (publickey). error it means you need to copy your key into the DDEV container by running ddev auth ssh.

Pull live content down for development

drush sql-sync @live @self
drush -y rsync --exclude-paths=css:js:php --verbose @live:%files/ @self:%files

Running the migration in development

Download the D7 files via the Backup and Migrate module.

Put the D7 files in the following location:

<Project Root>/d7/sites/default/files/

There is a reference to the sites/default/files in the database so that structure is mandatory for the migration.

The path in the upgrade_d7_file.yml migration file is different because this is executed inside the docker container so in the docker container the is: /var/www/html/ but no need to re-create those folders in the host machine.

Download a database dump of the D7 site via the Backup and Migrate module.

Create a database called drupal7:

Use ddev describe to see what the host and port are for your local environment, and use that in the first line here:

mysql --host=127.0.0.1 --port=32779 --user=root --password=root --database=db
CREATE DATABASE drupal7;
GRANT ALL ON drupal7.* to 'db'@'%' IDENTIFIED BY 'db';

Now ctrl+c out of there, and, again substituting the host and port for your own, import your file from whereever you placed and named your db SQL dump:

mysql --host=127.0.0.1 --port=32779 --user=root --password=root --database=drupal7 < data/db.mysql

(Above per instructions for creating another database in ddev.)

Once the files are in the correct place and the database has been created we can run the following to run all the migrations:

ddev . drush mim --group="migrate_drupal_7_geo"

Note: The migration will partially fail because of missing files. For now, re-run the migration command and it will complete the migration.

Running the migration on the hosted instance

  1. Ensure the files you need are uploaded to the server. Obtain the latest from the prior site: database, and files. Upload these to the server (e.g. scp *.gz geo_live@drutopia.org:) and we'll extract them there.
  2. If a deployment has been performed already, it must be moved out of the way by removing existing databases. Log into the server (ssh geo_live@drutopia.org) and remove the database(s):
    • Start the mysql client (logged into geo_live): mysql
    • Drop the drupal db: drop database geo_live;
    • Drop the migration source db: drop database geo_legacy;
    • Exit mysql by typing ctrl+d
  3. Extract the uploaded files (still on server):
    • Unzip the uploaded database file (this expects there to be only ONE such file): gunzip *.mysql.gz
    • Rename the database file: mv *.mysql geo_legacy.sql
    • Unpack the files, but first cd to where they go (again, there should only be ONE file ending in .tar.gz in home): cd site/d7/sites/default/files/ and untar: tar xzf ~/*.tar.gz (this will take a minute/two).
    • The server side is ready! Log off by typing ctrl+d
  4. Now perform a deployment with drutopia_hosting. This will install the site using the minimal profile and existing config:
    • ahoy deploy-build news
    • ahoy deploy-site geo_live
  5. Return to the server (ssh geo_live@drutopia.org), load legacy db and run the migration:
    • Read the db source into the proper database: mysql geo_legacy < geo_legacy.sql
    • drush mim --group="migrate_drupal_7_geo"
    • drush php:script article_type_term.php

Post go-live tasks

  1. Remove all d7 files: rm -rf site/d7 and rm geo_legacy.sql, etc.
  2. Change the site settings in hosting:
    • config_import -> True
    • php_settings_code -> blank
  3. Change the news build settings in hosting:
    • remove custom build commands (i.e. sed)
  4. At this point, the deploy should be typical (deploy-build/deploy-site as normal)