Skip to main content

Drupal 9 to 10 upgrade an example of the actual steps taken

 

Continuing on from the Drupal 9 to Drupal 10 upgrade outline written earlier... Upgrading Drupal 9 to Drupal 10.  However, the point of difference is this article works through the actual action steps of the upgrade.

Planning and testing is critical for the Drupal to version 10 process to work successfully.  As some of the environments that I work in are deployed via CD/CI pipelines.

Drupal set the private folder

How to set the Private file path in Drupal using the following steps:

  • Create a private folder in the web root
  • Add a .htaccess file to the private folder
  • Update the settings.php file

 

Exporting a MySQL table to a file

Goal: I want to download a table list to a txt or csv file.

Initially, as a root user I tried using drush

drush sql-dump --tables-list=media_field_data > db-list.sql

Of course as a root user and Drush set-up not as root. failed with 

Command 'drush' not found, did you mean:

  command 'rush' from deb rush (1.8+dfsg-1.1)

My bad.

mysql dump FLUSH TABLES access denied

I've recently upgraded the server Ubuntu 20.04 updating the PHP version from 7.4 to 8.1.  However, when I've attempted to export the MySQL database using the command

drush sql-dump --extra-dump=--no-tablespaces --result-file=../sql/db-2023-02-25.sql

I seeing the following response

Drupal: how to import the configuration on a different site

After cloning a site, next you will want to import the config file.  Which you can do so by running the command:

drush cim -y

Hopefully it worked for you.  As it didn't work out so well for me as the response was:

Drush a few common commands to import and reset

Working through and importing JSON data into a content type.

 

Drush migration commands

Check the status of the migration data

lando drush migrate-status

Reset the migration status 

lando drush migrate-reset-status  migratable_riverdata_json

Import JSON data

CLI using drush to drop tables in your db and reload

This is a relatively quick process, beginning with dropping the database tables

lando drush sql-drop -y

Import a MySQL database

lando db-import {filename}

such as 

lando db-import riverdev.2022-10-03-1664769553.sql.gz

Rebuild cache

lando drush cr

Finally, export your config

Running Drupal 9 locally with lando using remote files and db

Import a database

lando db-import doj.sql

Enter the MySQL database

lando mysql -h database

This action will change the prompt as you are now in mysql.  The prompt will start with

mysql>

Now change to the database that you want to use

use doj;

If you want to know what databases exist, then run

Subscribe to Drush