Skip to Content

Planet Drupal

Syndicate content - aggregated feeds in category Planet Drupal
Updated: 3 hours 45 min ago

Chris Hall on Drupal 8: D8 blog Alpha to Beta migration

15 March 2015 - 8:08am
D8 blog Alpha to Beta migration Sun, 03/15/2015 - 15:08 chrishu Still running on Drupal 8

Somewhat shocked to find that I have been running on Drupal 8 for well over 1.5 years now, not surprisingly the sense of urgency has kind of dropped off, but getting back into Drupal 8 again now. This site was originally based on Alpha 3  D8 and I even tried 'chasing head' for one iteratation, so it was alpha 3 with some crazy ass fixes.

Then I got a bit experimental, customised a couple of things etc. and fixed the brokeness that kept happening. Utimately as I focused on it again (whilst having experimented a little on dev site with Beta 3 in preparation for migration), I touched something and it went poof! I am somewhat used to the white screen of death on this site even the white screen of death that doesn't fix itself when you rollback the database, this time I didn't want to roll up my sleaves and attempt a fix, as far as I was concerned my site was the Norwegian Blue Parrot of Drupal installs.

Note: if working on a non-supported version of D8 kittens don't die if you hack core, in fact coping with Drupageddon etc. they are more likely to die if you don't.

Alpha to Beta problem, Mysql to the rescue

A quick assessment of options, I could look at the migration code already in D8 and attempt something but two things stopped me, firstly I have spent a lot of time working on D6 - D7 and D7 - D7 migrations recently and great though it is I am sick of it, secondly I needed something really quick, I had very little spare time over the next week, I slapped up a new site on a shiny new Ubuntu 14.04 VPS and posted a page to explain what was going on. 

More annoyingly for speed I need content to have the same node ids etc. not having any automated path functionality I had too many /node/{nid} urls already.

It turns out that the thing that has changed the least over the intervening time is the database structure (well there are some important differences but nothing that cannot be fixed on the fly). When I got some time a couple of beers and the following strategy:

  1. dump the orginal site from Mysql.
  2. prefix all the tables from the original alpha site with prefix (eg. in my case 'node' became 'rr_node'.
  3. load the alpha site tables into the beta site database (they are just ignored and do no harm).
  4. copy a dev version of the site and move the data from the alpha tables to the beta tables, making changes as needed.
  5. move the dev version to live.

It worked a charm (although at the point of writing this I still have to do the comments, I was just getting bored). A few hours effort in total to get the old content into the new site.  Nice to see that the database tables are pretty clean and fairly easy to interpret by eye if all else fails.

Some Mysql pointers

To replicate this approach you need to be able to fire up a Mysql client and be pretty comfortable looking around moving data around. A few things that may help follow.

You can wildcard show tables. show tables like '%node%';  will show you node related tables for example.

You can view the structure of a table with describe  eg. describe node;

Tables that have the same structure are very easy to populate insert into url_alias select * from rr_url_alias; tables where the structure varies (missing fields, field in a different order etc.) require the fields and field order to be specified insert into node_field_revision (nid, vid, langcode, title, uid, status, created, changed, promote, sticky, default_langcode) select nid, vid, langcode, title, uid, status, created, changed, promote, sticky, default_langcode from rr_node_field_revision;

Language codes have to match, my old database was full of 'und' the new one needed 'en'

Revisions are better flattened, a lot of the complication in folding the two structures together are around revisions, I did have revisions in my original alpha site (not because I needed them, just to kick the tyres). It was much easier to flatten the revisions, in simple tables just making vid = nid or revision_id = entity_id does the job BUT in tables like field tables where multiple revisions are tracked for the same entity you want to delete all the older revision and then keep the last one matching the revision_id to entity_id as appropriate. Drupal then just sees the content as having one revision and the last change will match the state as the last revision you had previously.

Give me a shout if you need help

I appeciate all the above is a bit holistic, as I said it took a few hours and a couple of beers from start to finish and was fairly hacky (I was cooking a meal at the same time etc.) I had no time to compile a structured migration guide (which may be different for your particular version of the site anyway), if you are confident with Mysql then a content migration (included taxonomy terms, etc etc. ) is a very feasible way to get ancient D8 content into a new spanking new D8 Beta and I FEEL GOOD

Happy to chip in if anyone else needs a hand.

Looking forward to trying out themeing now I have an up to date Drupal 8. 

Blog tags Comments Add new comment Your name Subject Comment About text formats Restricted HTML
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd> <h4> <h5> <h6>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.
Leave this field blank
Categories: Drupal

DrupalOnWindows: Benchmarking Drupal 7 on PHP 7-dev

15 March 2015 - 7:58am
Language English

There are big expectations surrounding PHP7.

PHP has seen the threat and needs to keep up with competitors such as HHVM or the recently open source and cross platform compatible .Net Framework. Even a while ago (2011) the .Net implementation of PHP (Phalanger) already was light years superior and much better performant than Zend Engine, and was proposed as a replacement of the Zend Engine (read the full story here).

More articles...
Categories: Drupal

Red Crackle: How to install Drupal 7 with Nginx, PHP-FPM and MySQL on Ubuntu 14.04

14 March 2015 - 8:30am
Ubuntu 14.04's package manager (apt) installs PHP 5.5 by default. Unfortunately Drupal 7 does not work on PHP 5.5. In this article, we will show you how to install PHP 5.3.29 with PHP-FPM on Ubuntu 14.04. On top of this, we will install Nginx and MySQL to have a working Drupal 7 website.
Categories: Drupal

OpenLucius: Headless Drupal. Why & how a RESTful API in Drupal?

14 March 2015 - 1:37am

We are currently working on a great ‘Headless’ project, based on our Drupal distro OpenLucius. Sounds scary, 'headless', but it is making us, Drupal backend developers, very happy.

Earlier I wrote a blog about Drupal web services: building a (RESTful) API on Drupal. This is also known as Headless Drupal. The phenomenon has been around longer, but in the past months Headless Drupal seems to be much more active. All over the world I see a lot of code and blogs appearing within this context.

Categories: Drupal

Wuinfo: Drupal Deploy Strategy

13 March 2015 - 2:19pm

Have been worked on many Drupal projects these years. Even though, most of the projects have version control system. But everyone has different ways. Today, I want to share one of them that I think is great. Because of it, there was no accident in the over 5 deployments during a half year period.

The biggest headache for Drupal deployment is the conflict between the configuration and the content. Content is moving downward from product to staging to development. But the configuration is moving upward from development to staging to production. Both of configuration and content are existing in a same database and same tables sometimes. So, we can not separate them and move the configuration only upward to production. We used features module and packed most of the configurations into several features. But there was some manual configuration we had to do. The CTO did not want developers to have administrator access to the production server. I agree that it is a good idea, since it helps stabilize the production environment. But they had to have someone know Drupal to configure the production site. So, they appoint me as configuration manager position to do that job. Well, the good news is Drupal 8 have moved configuration into code. Hopefully, that will solve the problem gracefully.

It was a typical Drupal website for a small content publisher. We had 5 Drupal developers, 2 QAs, a project manager and a business analyst. We had a group of in-house editors who would be very upset if our system had something wrong during deployment. We needed a good strategy to make sure successful deployment within the maintenance window. Usually, the downtime was 2 hours.

We used Jira for the issue queue. There was a Jira expert helped us set up the process. Issue went through various stakeholders according the designed process. Project manager would decide whether to approve each ticket for next release. Developers would see all the approved tickets in a working pool. After solve the problem, developers marked the ticket as done. It would then in the queue of the configuration manager. In the end, configuration manager would make a quick snapshot of the dev branch and mark all the related tickets as QA ready. He then worked with system admin to push the code to staging and did any necessary manual configurations. We were using features module extensively. It kept the manual configuration at minimal. We also put all the necessary manual configuration steps in Jira tickets. QA then got onto the staging server and verified and approved each ticket. Ticket had failed to pass QA will be disapproved, and dev team had to deal with it again. The whole process was reiterated until every ticket passed QA. Then QA marked all the tickets as passed.

At last, configuration manager used the latest release tag and merged the Git dev branch into the production branch. Make a release version tag on production. Also after that, merge back all the hotfix branch back into the dev branch. There is a great article about Git branching model. I think it worthy of time to read it for every developer.

Categories: Drupal

Another Drop in the Drupal Sea: Welcome some of Drupal's new community members!

13 March 2015 - 2:09pm

I am pleased to welcome to the Drupal community:

They are students in my Udemy pilot course Start Successfully; Install Drupal Easily & Quickly. Why not stop on by their pages and send them a warm welcome through their contact forms?

Categories: Drupal

DrupalCon News: Announcing DrupalCon Los Angeles Keynote Speaker Matt Asay

13 March 2015 - 11:21am

While seeing the Driesnote is always a highlight of every DrupalCon, this year's other keynote speakers are guaranteed to please as well. We are excited to announce one of the keynote speakers for DrupalCon Los Angeles: on Wednesday morning, expect to hear from Matt Asay, a seasoned open source professional and regular tech columnist.

Categories: Drupal

Shomeya: Adding the 'button' class to Drupal submit buttons

13 March 2015 - 10:25am

In just 2 hours my fully finished Foundation 5 (any framework) to Drupal 7 guide will go live. Just for our readers there's 20% off right up until 12pm PDT when the final version goes live!

In honor of integrating frameworks with Drupal, here's some fun code snippets to get you adding classes without using Sass.

Once you have an awesome new framework how do you make the buttons match the awesomeness?

Read more
Categories: Drupal

Promet Source: Drupal in Gov: Open source platforms &amp; civic website development

13 March 2015 - 9:52am
Why Drupal is the perfect solution for civic website projects  
Categories: Drupal

Mediacurrent: Mediacurrent Acquired by Code and Theory: Our Journey

13 March 2015 - 7:00am

We are proud to announce that Mediacurrent has been acquired by Code and Theory, an independent creative agency that creates products, content and campaigns across physical and digital worlds.

The combined company will bring together more than 350 extremely talented people, and assemble one of the most formidable, independently-owned creative agencies in the world.

Categories: Drupal

Code Karate: Adding Git to an existing Drupal project

13 March 2015 - 6:11am

I recently received an email from someone who finished reading the

Categories: Drupal

Chen Hui Jing: Drupal 101: What I learnt from hours of troubleshooting Feeds

12 March 2015 - 5:00pm

Feeds is a very useful module when it comes to importing content into your Drupal site. However, it’s not very forgiving, in that your data has to be formatted just right for the feed to take. This post will run through the basic feed importers and some key points I learnt from hours upon hours of troubleshooting. I’m pretty sure I’ve spent upwards of 50 hours dealing with feeds thus far in my life.

Before I begin, I have a short rant on the importance of content. You could skip directly to the bits on feeds but then, it’ll be less entertaining.

The heart of every website is its content. At least, most of the time. And as much...

Categories: Drupal

Drupal Easy: Florida DrupalCamp 2015 - It's SSSSuper

12 March 2015 - 12:00pm

For the sixth year in a row, Central Florida will host the Sunshine State's largest gathering of Drupalists for two full days of learning, networking, and sharing at Florida DrupalCamp 2015. To be held Saturday and Sunday, April 11-12, 2015 at Florida Technical College in Orlando, approximately 300 people will gather for a full day of sessions and a full day of community contributions. Attendees will be provided with knowledge, food, and clothing - and maybe a surprise or two as well!


read more

Categories: Drupal

Cheeky Monkey Media: Importing and Exporting Databases with Drush

12 March 2015 - 10:25am

A few weeks ago, I was pulled into a Non-Drupal project. As I was configuring the site to run on my local computer, I realized that I have been taking advantage of Drupal and Drush. I forgot how easy it was to import and export MYSQL databases. If you're a drupal developer and are not using drush to import and export your databases, you should. It will save you time, and its easy.

Configure Settings.php

Before you attempt to import a new database, make sure you have the database configurations setup properly in settings.php. If you don't have this specified, drush...Read More

Categories: Drupal

Code Karate: Drupal 7 Excluding Node ID from URL

12 March 2015 - 5:11am
Episode Number: 197

In this installment of the Daily Dose of Drupal, we are looking not at a module, but rather how to exclude a node from a view using the node/content ID.

The video explanation will put a lot more context around exactly what I mean, but the general idea is using a view we will be able to exclude the current node id we are on (grabbed from the URL) from the view. In other words, if you are on a page about grasshoppers the view possibly on the sidebar that displays other insects won't have the grasshopper listed (ie since we are already on this page).

Tags: DrupalBlocksContent TypesViewsDrupal 7Drupal Planet
Categories: Drupal

Acquia: Writing secure PHP: "F.I.E.O." and more - meet Chris Cornutt

11 March 2015 - 2:57pm
Language Undefined

PHP security expert and member of the Global Cybersecurity Group at Hewlett Packard, Chris Cornutt and I had the chance to meet in person at PHP World 2014, in Washington, D.C. We compared notes on the "PHP Renaissance", looking over other projects' shoulders, sharing code, and PHP security basics.

Categories: Drupal

Drupalpress, Drupal in the Health Sciences Library at UVA: equipment booking system — background

11 March 2015 - 1:53pm

This is the first in what’s going to be a series of posts documenting our equipment booking system project. We’re developers working at a library that circulates equipment (laptops, tablets, cameras, etc.) — and we’re sick of maintaining the custom PHP application that manages the reservation process. So we built the whole thing into our existing Drupal site. I say “built” because it’s done … or at least sitting on the production server waiting for content to be entered. We’re doing the documentation after the fact, so I’ll try to pick and choose what’s worth putting out there. I’m guessing that will boil down to plugging a few modules and spending way too much time writing about the PHP script we used to check for reservation conflicts. We’ll see.

The beginning of the project was deciding whether or not we wanted to use a module to manage the reservation process. Actually the beginning was MERCI— we got a little turned around on this one … picked the module and pitched it before we had everything specd out. Once we dug in, MERCI turned out to be a reasonable module but just a little heavier than what we needed. In particular, the “bucket and “resource” model was too much and it was kind of a pain to manage without being able to get into the field configurations. We also tested out Commerce Stock for its inventory tools. Way heavier than MERCI.  To use Commerce Stock we would have to install Commerce and everything that comes with it. Rather than ripping things out that we weren’t going to use (or adding more to our already overstuffed stack) we decided to build the whole thing with content types, rules and views.

No problem right?

Categories: Drupal

Mediacurrent: Contrib Committee Status Report, February 2015

11 March 2015 - 1:46pm

Our second month of having the contrib committee in place was a little slower in some ways than January. By the numbers, we put in just over 110 hours of non-billable time on contrib projects. There were many reasons for the drop in hours from January – several team members were putting their non-billable time into learning Drupal 8, the lack of a code sprint, and planning began on a number of camps for 2015. Also, remember that this is non-billable work – billable contrib work continues to be a priority for Mediacurrent and our clients.

Categories: Drupal

about seo