417 lines
16 KiB
HTML
417 lines
16 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>Migrate Your Way to Drupal 8 Greatness</title>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width">
|
|
<style>
|
|
|
|
@import url(http://fonts.googleapis.com/css?family=Ubuntu:500|Quattrocento+Sans:400,700,400italic);
|
|
|
|
section {
|
|
background-color: white;
|
|
color: black;
|
|
padding: 2em;
|
|
font-family: "Quattrocento Sans", Helvetica, Verdana, sans-serif;
|
|
font-weight: 400;
|
|
background-size: cover;
|
|
}
|
|
|
|
section.reverse {
|
|
background-color: #0678be;
|
|
color: white;
|
|
}
|
|
|
|
a:link,
|
|
a:visited {
|
|
color: #99CCFF;
|
|
text-decoration: none;
|
|
}
|
|
|
|
section.reverse a:link,
|
|
section.reverse a:visited {
|
|
color: yellow;
|
|
}
|
|
|
|
a:hover {
|
|
text-decoration: underline;
|
|
}
|
|
|
|
section p {
|
|
font-size: 1em;
|
|
line-height: 1.4;
|
|
}
|
|
|
|
section strong {
|
|
font-weight: 700;
|
|
}
|
|
|
|
h1,h2,h3,h4,h5,h6 {
|
|
font-family: Ubuntu, Arial, sans-serif;
|
|
font-weight: 500;
|
|
text-align: center;
|
|
}
|
|
|
|
h1 {
|
|
font-size: 2em;
|
|
}
|
|
|
|
.big li {
|
|
font-size: 1.2em;
|
|
}
|
|
|
|
img {
|
|
margin-left: auto;
|
|
margin-right: auto;
|
|
}
|
|
|
|
cite {
|
|
font-size: .8em;
|
|
color: #eee;
|
|
position: absolute;
|
|
bottom: 0;
|
|
}
|
|
|
|
.dark {
|
|
color: #111;
|
|
}
|
|
|
|
.dark a {
|
|
color: #0678be;
|
|
}
|
|
|
|
blockquote cite {
|
|
color: inherit;
|
|
display: block;
|
|
position: relative;
|
|
text-align: right;
|
|
padding-right: 1em;
|
|
}
|
|
|
|
blockquote cite::before {
|
|
content: "—";
|
|
}
|
|
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
<section class="reverse" style="padding-top: 2em">
|
|
<h1>Migrate Your Way<br />to Drupal 8 Greatness</h1>
|
|
<h2>Bring in content from older Drupal sites, other databases, or HTML files</h2>
|
|
<h4><a href="https://etherpad.net/p/d8migrate">etherpad.net/p/d8migrate</a></h4>
|
|
<h4><a href="https://mlncn.withknown.com/">@mlncn</a><br />
|
|
<a href="http://agaric.com/">agaric.com</a></h4>
|
|
</section>
|
|
|
|
|
|
<section style="background-image: url(upgrade-database-settings-php.png); background-size: contain; background-position: center; background-repeat: no-repeat;">
|
|
</section>
|
|
|
|
<section>
|
|
<pre>
|
|
drush migrate-upgrade --legacy-root=http://data.agaric.com --configure-only
|
|
</pre>
|
|
</section>
|
|
|
|
<section style="background-image:url(drush-migrate-upgrade-configure-only.png); background-size: contain; background-repeat: no-repeat; background-position: center center; background-color: gray;">
|
|
<!-- This is working with the same 'upgrade' database with the source database credentials in settings.local.php -->
|
|
</section>
|
|
|
|
|
|
<section style="background-image:url(upgrade-database-settings-php-drupal_6.png);">
|
|
<!-- Bizarrely, to actually run the migration we just configured, we have to change the label for the source database to drupal_6, which is the name of the migration group that was created. Just go along with it; i blundered through this so you wouldn't have to. -->
|
|
</section>
|
|
|
|
|
|
<section style="background-image:url(drush-migrate-import-all.png);">
|
|
<!-- Now we can run the migration! OK, we could do that before, but now we can re-run and make tweaks. -->
|
|
</section>
|
|
|
|
<section>
|
|
<pre>
|
|
drush mr --all
|
|
</pre>
|
|
<!-- Granted, the ability to roll back a migration is not as crucial when you could get to the same state by re-installing the site -->
|
|
</section>
|
|
|
|
<section style="background-image:url(missing-filter-plugins.png)">
|
|
</section>
|
|
|
|
<section style="background-image:url(bluemarine.png);">
|
|
<!-- What if you're coming from an older version of Drupal than Drupal 6? If you're coming from Drupal 4.7 and the state-of-the-art Bluemarine theme (still tables-based), first off what time warp did you walk out of, . -->
|
|
</section>
|
|
|
|
<section style="background-image:url(drupal5-garland-cyrillic.png);">
|
|
<!-- Ah, Drupal 5 and the Garland theme. Showing off multilingual capabilities, and XHTML 1.0! I hope there are no cuss words on there. There are not currently any supported upgrade-style migration plugins for Drupal 5 or earlier. You can either use Drupal's in-place upgrading process to update them to Drupal 6, and then use migrate upgrade— or you can take the custom migration approach, which is probably better than taking anything more than necessary from a site a decade or more old. So let's talk about that approach where we're building the migration tunnel ourselves... -->
|
|
</section>
|
|
|
|
<section style="background-image:url(12412508015_1e5340004b_k.jpg);">
|
|
<!-- The first thing you do to migrate is build a Drupal site. Yes, build the Drupal 8 site first. You don't need the theme yet. That can wait for the content. But you need the structure.-->
|
|
<cite style="margin-left: 13em">George Pankewytch, <a href="https://www.flickr.com/photos/gwp57/12412508015/in/photolist-jURmbT-bA2kjP-oRrdMA-jUTRW9-bp7ELM-iZDTWg-idzeyL-2V2uSq-4t2DEw-dqmnbS-7G3Ahs-bzmwVL-6rXkoU-7FYCQZ-7G3LYb-7G3Cvb-4UxjPw-7FYPoD-7G3Ej7-7G3JGS-5TvBSK-7FYP3K-7FYMpp-7V5XGc-nUsvgg-9Bu87Y-nY3uWi-7FYL7X-7G3zN7-7FYRsD-7G3Fah-q4vWzR-8Cocj-awv86s-nY3uXR-7G3H4Q-6NaA5y-7G3FEb-7G3Lzh-bcubtk-7FYJa2-dGnaRW-g6kSZd-nSF7ta-7G3LbU-4VBEfb-7hdcwr-aWUL3M-7ySngF-5TzV6o">16 Months after Sandy</a></cite>
|
|
</section>
|
|
<section style="background-image:url(house-blueprints.jpg); background-position: bottom center">
|
|
<!-- Define your new content structure, on paper. Palantir has example. -->
|
|
</section>
|
|
|
|
<section style="background-image:url(drutopia-homepage.png);">
|
|
<!-- One reason we can't build before -->
|
|
</section>
|
|
|
|
|
|
<section style="background-image:url(4154868194_14f8918c77_o.jpg);">
|
|
<!-- You cannot bring the content in first. That will look like this. -->
|
|
|
|
<cite>Wil Carraway, <a href="https://www.flickr.com/photos/carraways_photography/4154868194/in/photolist-7k9Myw-G5AUJR-4ArZGX-bwbBCp-goGgzt-dUFCXq-7Q2V4Y-boLRSY-62XsPF-E3JW8-mDLfwt-dr3Ux6-kCPGXx-9r9xTg-5E5PYC-aMBCUp-fKtoNR-7m2Cw9-pweMqq-b4cNJX-89juAe-dPZiKF-nzWwfD-pRcSpP-5u18Ud-mCFcFX-y9Rrpi-jAPFyv-8yHyC4-ehBxt-E2osU-9zRpGb-bzdXnu-qmtQ6g-8B6mDp-5QA5Xu-9p88cW-pAYqk-7ekyPh-dPYpMS-akVDzB-23Gukc-6Bgqn8-aQ6UDB-5SuDfQ-9Cxxgx-dr3Wpt-suD6p2-dVyHgK-85jYrw/">Pile of Junk</a></cite>
|
|
</section>
|
|
|
|
<section style="background-image:url(Grus_grus_-migrating_north-6a.jpg);">
|
|
<!-- OK. You have some sense of where you're trying to go. -->
|
|
</section>
|
|
|
|
<section class="reverse">
|
|
<p style="margin-left: 7em; margin-top: 6em;"><big><code>
|
|
1 * #Entities<br />
|
|
+ 2 * #Fields<br />
|
|
= Migration Complexity</code></big></p>
|
|
<!-- This adds up faster than you think. Five content types and one user with an average of eight fields each equals 6*1 + 6*8*2 = 102, at two hours per complexity point, that's 204 hours, or more than a month of one person's work, or $30,600 -->
|
|
<!-- You'll note what i did *not* say, what is missing from that formula, is any mention of pieces of content. The more *pieces* of content you have relative to types of contest, the better the 'deal' you get. -->
|
|
</section>
|
|
|
|
<section style="background-image:url(btm-y88ciaav59f.jpg);">
|
|
<!-- -->
|
|
<blockquote style="background-color: white; padding: .3em;">You're not going to migrate in your schema that you had in Drupal 7 or 6 or Joomla...</blockquote>
|
|
<cite>disco insolence, <a href="https://discoinsolence.wordpress.com/2013/09/04/solvognens-tangle-of-wires/">Solvognen’s Tangle Of Wires</a></cite>
|
|
</section>
|
|
|
|
<section style="background-image:url(400041711_fwSZpkHK_c.jpg);">
|
|
<!-- -->
|
|
<blockquote style="background-color: white; padding: .3em;">...you'll build it exactly as you want it in Drupal 8.<cite>Les Lim</cite></blockquote>
|
|
</section>
|
|
|
|
<section style="background-image:url(img_20160624_180333_1024.jpg);">
|
|
<!-- To go back to the house analogy, you want to have built the perfect house— but not furnished yet. -->
|
|
</section>
|
|
|
|
<section style="background-image:url(tcdrupal-badge-character-encoding.jpg); background-size: 20em; background-position: center; background-repeat: no-repeat; padding-bottom: -15em;">
|
|
<!-- My badge helpfully illustrates a common migration issue: character encoding -->
|
|
</section>
|
|
|
|
<section style="background-image:url(substitition-to-remove-extra-quotation-marks.png)">
|
|
</section>
|
|
|
|
|
|
<section class="reverse">
|
|
<br /><br />
|
|
<blockquote>Migrate module is using a more general process called extract, transform, and load, or ETL.<cite>Brad Lowry</cite></blockquote>
|
|
<br /><br /><br />
|
|
<!-- Or if you want the official statement of the same, from the Migration API documentation -->
|
|
<blockquote>Migration is an <a href="https://en.wikipedia.org/wiki/Extract,_transform,_load">Extract, Transform, Load (ETL)</a> process. For historical reasons, in the Drupal migration tool the extract phase is called "source", the transform phase is called "process", and the load phase is called "destination".
|
|
<cite><a href="https://api.drupal.org/api/drupal/core%21modules%21migrate%21migrate.api.php/group/migration/8.2.x">Migration API</a></cite>
|
|
</section>
|
|
|
|
<section style="background-image:url(ralph-kimball-etl-data-warehouse.png); background-size:contain; background-position: center; background-repeat: no-repeat;">
|
|
<!-- Cover of a Ralph Kimball book.
|
|
If you like to understand the theory behind what you're doing, read a Ralph Kimbal book. Keep in mind, however, that If you just want -->
|
|
<cite>Attrib, <a href="">""</a></cite>
|
|
</section>
|
|
|
|
<section style="background-image: url(migrate-plus-releases-screenshot-2016-09-25.png); background-size: contain; background-position: center; background-repeat: no-repeat;">
|
|
<!-- Currently, these contributed modules lag behind This is the versions currently available for Migrate Plus. So while it might seem like a good idea to start building on the latest version of Drupal 8 available (it probably wasn't a good idea anyway), it's a bad idea if you want to build your migration early in the process. And building the migration early in the process is a good idea-->
|
|
</section>
|
|
|
|
<section>
|
|
In a file <code>agaric_migrate.info.yml</code>:
|
|
<pre>
|
|
type: module
|
|
name: Agaric Migrate
|
|
description: "Migrate from Agaric's Drupal 7 site to its new Agaric 8 site."
|
|
package: Migrate
|
|
core: 8.x
|
|
dependencies:
|
|
- migrate
|
|
- migrate_plus
|
|
</pre>
|
|
</section>
|
|
|
|
<section>
|
|
<p>For more complex processing, you can add process plugins.</p>
|
|
|
|
<p>In a file like <code>src/Plugin/migrate/process/NerdUserRoles.php</code></p>
|
|
|
|
<p>You start out with:</p>
|
|
<pre>
|
|
namespace Drupal\nerdcustom\Plugin\migrate\process;
|
|
use Drupal\migrate\ProcessPluginBase;
|
|
use Drupal\migrate\MigrateExecutableInterface;
|
|
use Drupal\migrate\Row;
|
|
</pre>
|
|
|
|
<cite><a href="https://github.com/stevector/nerdologues-d8/blob/master/modules/custom/nerdcustom/src/Plugin/migrate/process/NerdUserRoles.php">github.com/stevector/nerdologues-d8</a></cite>
|
|
</section>
|
|
|
|
<!-- I'm showing you this because a bunch of improv comedians are ahead of my professional web development company in migrating to Drupal 8. -->
|
|
|
|
<section>
|
|
<pre>
|
|
/**
|
|
* This plugin maps old roles to new roles.
|
|
*
|
|
* @MigrateProcessPlugin(
|
|
* id = "nerd_user_roles"
|
|
* )
|
|
*/
|
|
class NerdUserRoles extends ProcessPluginBase {
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
|
|
if ($value == 3) {
|
|
return 'administrator';
|
|
}
|
|
elseif ($value == 4) {
|
|
return 'content_administrator';
|
|
}
|
|
}
|
|
}
|
|
</pre>
|
|
</section>
|
|
|
|
<!-- If nothing else, i hope this presentation has shown you that migration is not just for the birds. -->
|
|
<section style="background-image: url(loggerhead_turtles_migration_282.jpg);">
|
|
<cite>earthtimes.org, <a href="http://www.earthtimes.org/nature/loggerhead-turtle-migration-mystery-solved/332/">Loggerhead turtle migration mystery solved</a></cite>
|
|
</section>
|
|
|
|
<section class="reverse" style="padding:6em 10em; background-image: url(turtle-in-sand.png); background-size: contain; background-position: bottom center; background-repeat: no-repeat;">
|
|
<h4><a href="https://etherpad.net/p/d8migrate">etherpad.net/p/d8migrate</a></h4>
|
|
<h4><a href="http://mlncn.withknown.com/" rel="author">benjamin melançon</a></h4>
|
|
<h5><a href="mailto:ben@agaric.com">ben@agaric.com</a></h5>
|
|
<h5><a href="https://twitter.com/mlncn">@mlncn</a></h5>
|
|
</section>
|
|
|
|
<section>
|
|
<h2>Reading & Resources</h2>
|
|
<ul>
|
|
<li><a href="https://www.drupal.org/docs/8/upgrade/upgrading-from-drupal-6-or-7-to-drupal-8">drupal.org/docs/8/upgrade/upgrading-from-drupal-6-or-7-to-drupal-8</a></li>
|
|
<li>Recommended way, with Drush, is in the sub-page of these instructions called <a href="https://www.drupal.org/node/2350651">Upgrade using Drush (at drupal.org/node/2350651)</a></li>
|
|
<li>All the options - automatic, mixed, and manual: <a href="https://github.com/kafeiinteractif/shotgun-migrate-tour">github.com/kafeiinteractif/shotgun-migrate-tour</a></li>
|
|
<li><a href="http://dspeak.com/fldc14/migrate.html">dspeak.com/fldc14/migrate.html</a> (has most background of migrate-in-D8 effort, probably view as historical document)</li>
|
|
<li>From a non-Drupal database <a href="http://www.jeffgeerling.com/blog/2016/migrating-20000-images-audio-clips-and-video-clips-drupal-8">www.jeffgeerling.com/blog/2016/migrating-20000-images-audio-clips-and-video-clips-drupal-8</a> (even though the example is from Drupal, it's really about the non-upgrade approach)Non-Drupal database</li>
|
|
<li>https://www.chapterthree.com/blog/drupal-to-drupal-8-via-migrate-api</li>
|
|
</ul>
|
|
</section>
|
|
|
|
<section id="lorenz" style="text-align:center;padding-top:0;">
|
|
<canvas></canvas>
|
|
</section>
|
|
|
|
<section style="background-image: url(.jpg);">
|
|
<h2 style="margin-top: 10em">.</h2>
|
|
<cite><a href="https://www.flickr.com/photos/littlesister/">IndyDina</a>, ""</cite>
|
|
</section>
|
|
|
|
<section class="reverse" style="background-image:url(doctorow-civilwar-spreadsheet.jpeg);">
|
|
<blockquote style="background-color: black; padding: 0.5em"><big><big> </big></big></blockquote>
|
|
<!-- -->
|
|
<cite>Cory Doctorow, <a href="http://boingboing.net/2012/08/23/civilwar.html">"The coming civil war over general purpose computing"</a></cite>
|
|
</section>
|
|
|
|
<section style="background-image:url(1413479953ewaste2.jpg);">
|
|
<!-- .-->
|
|
</section>
|
|
|
|
<section>
|
|
<h2></h2>
|
|
<ul>
|
|
<li></li>
|
|
<li></li>
|
|
<li></li>
|
|
</ul>
|
|
</section>
|
|
|
|
<script src="d3.v3.min.js"></script>
|
|
<script src="stack.v1.js"></script>
|
|
<script>
|
|
|
|
var mystack = stack()
|
|
.on("activate", activate)
|
|
.on("deactivate", deactivate);
|
|
|
|
var section = d3.selectAll("section"),
|
|
lorenz = d3.select("#lorenz"),
|
|
lorenzIndex = section[0].indexOf(lorenz.node());
|
|
|
|
function activate(d, i) {
|
|
if (i === lorenzIndex) startLorenz();
|
|
}
|
|
|
|
function deactivate(d, i) {
|
|
if (i === lorenzIndex) stopLorenz();
|
|
}
|
|
|
|
var lorenzInterval;
|
|
|
|
function startLorenz() {
|
|
var δτ = 0.003,
|
|
ρ = 28,
|
|
σ = 10,
|
|
β = 8 / 3,
|
|
x = .5,
|
|
y = .5,
|
|
z = 10,
|
|
n = 30;
|
|
|
|
var width = 1280,
|
|
height = 720;
|
|
|
|
var canvas = d3.select("canvas")
|
|
.style("position", "absolute")
|
|
.style("top", 0)
|
|
.style("left", 0)
|
|
.style("width", "100%")
|
|
.style("height", "100%")
|
|
.attr("width", width)
|
|
.attr("height", height);
|
|
|
|
var color = d3.scale.linear()
|
|
.domain([0, 20, 30, 50])
|
|
.range(["yellow", "orange", "brown", "purple"])
|
|
.interpolate(d3.interpolateHcl);
|
|
|
|
var context = canvas.node().getContext("2d");
|
|
|
|
context.lineWidth = .2;
|
|
context.fillStyle = "rgba(0,0,0,.03)";
|
|
|
|
d3.timer(function() {
|
|
context.save();
|
|
context.globalCompositeOperation = "lighter";
|
|
context.translate(width / 2, height / 2);
|
|
context.scale(12, 14);
|
|
context.rotate(30);
|
|
for (var i = 0; i < n; ++i) {
|
|
context.strokeStyle = color(z);
|
|
context.beginPath();
|
|
context.moveTo(x, y);
|
|
x += δτ * σ * (y - x);
|
|
y += δτ * (x * (ρ - z) - y);
|
|
z += δτ * (x * y - β * z);
|
|
context.lineTo(x, y);
|
|
context.stroke();
|
|
}
|
|
context.restore();
|
|
return !lorenzInterval;
|
|
});
|
|
|
|
lorenzInterval = setInterval(function() {
|
|
context.fillRect(0, 0, width, height);
|
|
}, 100);
|
|
}
|
|
|
|
function stopLorenz() {
|
|
lorenzInterval = clearInterval(lorenzInterval);
|
|
}
|
|
|
|
</script>
|
|
</body>
|
|
</html>
|