drupal

Golems GABB: Exploring Drupal's Entity API: Tips and Tricks for Better Site Development

Exploring Drupal's Entity API: Tips and Tricks for Better Site Development Editor Fri, 02/16/2024 - 12:34

Crafting the digital landscape has never been more intuitive than with Drupal's Entity API. Developers wield the power to forge bespoke content types and intricately weave data relationships for these types, all effortlessly. 
This is not just a system; it has a lot of capabilities and a comprehensive API that makes the art of form creation, data validation, configuration, and even the orchestration of routes. The web realm becomes a canvas for innovation, and Drupal stands as the master artist's palette, inviting exceptional content and curating unparalleled web experiences. 
For enterprises seeking the zenith of scalability, adaptability, and impregnable security, Drupal stands tall, its architecture a bastion of strength, integration as seamless as an artist's brushstroke. Ready to embark on your digital odyssey with us, the Golems team

Drupal.org blog: It's time to migrate from Drupal 7. Let me show you (how to start)

Note: this is a refresh of an old article I wrote in my previous life as a Technical Solutions Manager in Acquia. The old approach uses Drush, while the 2024 version is much faster to set up and easy to use through the Drupal UI. Read the old article in Acquia.com (Thanks Jenn ShramekSylvie Tse and Randy Fay to help me find this lost content)

Are you ready to bid adieu to Drupal 7 and embrace the possibilities of Drupal 10+? The transition may seem daunting, but fear not, because I'm here to guide you through the process of migrating from the aging Drupal 7 to the modern Drupal 10+. 

While there are countless technical articles detailing the intricacies of migrating, I'm here to shed light on a crucial aspect often overlooked - building the infrastructure to seamlessly transition from Drupal 7 to Drupal 10+.

I´m assuming you already have a Drupal 7 site (what are you doing here if not?). The first step in this journey then is to create a new Drupal 10+ site that will serve as the destination for your migration.

Let´s create your new Drupal 10+ site

First, let’s create the Drupal 10+ site, where all the content, content types, and configurations from Drupal 7 will eventually reside. Follow these steps:

  • Create a new directory for your Drupal 10+ site, for instance, alexmoreno-drupal10.
  • Navigate to this directory.
  • Use DDEV to configure the project, specifying the project type as Drupal 10+ and the document root as web. 
  • ddev config --project-type=drupal10 --docroot=web --create-docroot

Next, we’ll install Drupal 10+ using Composer. If you have questions or you get stuck here I would recommend you to visit the excellent quickstart guide at https://ddev.readthedocs.io/en/latest/users/quickstart/#drupal. 

Install the modules you need to execute the migration

Now, visit http://drupal10.ddev.site/admin/modules to install the necessary modules:

  • Migrate Drupal UI, 
  • Migrate Drupal, 
  • and Migrate.

Image removed.

Image removed.

Connect the machines (Drupal 7 and Drupal 10+ containers)

To connect to the Drupal 7 database from within the Drupal 10 container, you are going to need the urls of the Drupal 7 container, and in particular, the database url. While  ddev status will give you those URLs and passwords, what is not telling is the url to connect from an external service, in this case, another Docker container.

The good Randy Fay pointed me in the right direction. The trick is described here: https://ddev.readthedocs.io/en/latest/users/usage/faq/#can-different-projects-communicate-with-each-other So, in order to connect from outside of the container you just need to use this as the url: ddev-projectname-db

For example, in my case my project is called alexmorenotdotnet. Then the database url will be: ddev-alexmorenotdotnet-db

Image removed.

Image removed.

Migrate

That's it, let's do it. Now simply quick off the migration and, evoilá, in a few minutes you should have a shiny brand new Drupal 10+ site.

While this migration process may seem straightforward, as the Drupal 7 site that I used was pretty simple, it lays the groundwork for more complex migrations. For those seeking advanced options, tools like Acquia Migrate Accelerate, now open-source, offer additional capabilities.

Wrapping up

Ready to take the leap? The decision has been made. You're moving on from your trusted Drupal 7 site to embrace Drupal 10+ with enthusiasm. But how do you manage two sites in parallel to test your migrations? Enter DDEV.

DDEV simplifies the process by allowing you to:

  • Start one instance: Spin up your Drupal 7 and Drupal 10+ instances concurrently.
  • Run the migration: Execute and test your migrations on the Drupal 10+ instance while keeping the Drupal 7 site running for reference and comparison.

With DDEV, transitioning from Drupal 7 to Drupal 10+ becomes not just manageable but efficient.

In conclusion, as you bid farewell to Drupal 7 and embark on the journey to Drupal 10+, remember that the process is not just about migrating data but also about setting up the infrastructure that supports seamless migration and testing.

This technique allows you to communicate between two containers, Drupal 7 and Drupal 10+. However this can be applied to a lot of other scenarios, like for example building a decoupled site where you need to connect two boxes with your frontend and your backend.

Are you ready to make the move? Share your thoughts in the comments below or contact me through Linkedin, Twitter or Mastodon.

Related links

Acquia Migrate Accelerate
https://www.acquia.com/products/drupal-cloud/acquia-migrate-accelerate

Acquia Migrate Accelerate tutorial
https://ddev.com/blog/drupal7-drupal9-migration-ddev-acquia-migrate-accelerate/

Retrofit
https://mglaman.dev/blog/protect-your-investment-drupal-7-retrofit-drupal
 

Lullabot: Lullabot Podcast: Navigating the Waters of Drupal Development with Tugboat

We embark on a journey, guided by a Tugboat, through the evolving landscape of Drupal development. This episode of the Lullabot Podcast dives deep into the world of Tugboat's seamless integration on Drupal.org. It's a pivotal tool that's redefining the paradigms of building, testing, and deploying Drupal projects.

Drupal Core News: RFC Remove support for Windows in production in Drupal 11

Drupal added support for IIS in 2010 and we have supported that and WAMP (Running Apache and PHP on Windows). Unfortunately, we have never been able to provide automated testing for these environments.  And since 2010, the use of Microsoft products for hosting websites has declined. Because of this, the Drupal core committers propose drop support for Windows when used on production web sites in Drupal 11.

Support for development on Windows will continue. Drupal will continue to accept bug reports for Windows used in development environments,

The following links show the usage statistics used when making this proposal.

Comment period

Community feedback is sought on the proposed process. Please use this issue to add your input. The feedback period will last until Friday March 8 2024.

The Drop Times: Drupal's Innovation and Future: Share Your Perspectives!

Drupal's success story is written by its community and its users. As the web landscape evolves, understanding the Drupal community's vision for ensuring Drupal remains innovative, adaptable, and inclusive is important. To get a pulse on where Drupal is headed, The Drop Times is launching a special project to gather insights directly from people in the Drupal community and Drupal users. Your perspectives will shape a series of articles focused on "Drupal's Innovation and Future: 2024 and Beyond." In our first article, we connected with diverse experts exploring challenges and opportunities. Now, it's your turn!

DrupalEasy: DrupalEasy Podcast S16E5 - Jim Birch - Recipes

We talk with Jim Birch about the Recipes strategic initiative for Drupal. 

URLs mentioned

DrupalEasy News

Audio transcript 

We're using the machine-driven Amazon Transcribe service to provide an audio transcript of this episode.

Subscribe

Subscribe to our podcast on iTunes, Google Play, iHeart, Amazon, YouTube, or Spotify.

If you'd like to leave us a voicemail, call 321-396-2340. Please keep in mind that we might play your voicemail during one of our future podcasts. Feel free to call in with suggestions, rants, questions, or corrections. If you'd rather just send us an email, please use our contact page.

Credits

Podcast edited by Amelia Anello.