Post

DDev Cheatsheat

Start a new project

cd into your project root directory. Then run the ddev config command and choose your project settings.

1
ddev config

Start an existing project

1
ddev start 

Import db

1
ddev import-db --file=./file.sql

Export db

1
ddev export-db 

Migrate to mysql:8.0 database

Convert your DDev Database to MySQL -

Troubleshoot

ERROR 1273 (HY000) at line 1223: Unknown collation: utf8mb4_0900_ai_ci

The error ERROR 1273 (HY000): Unknown collation: utf8mb4_0900_ai_ci indicates that the collation utf8mb4_0900_ai_ci is not recognized by your MySQL server. This collation is specific to MySQL 8.0 and later versions. If you’re running an older version of MySQL, such as MySQL 5.7 or earlier, it won’t support this collation.

Convert mysql:8.0 to mariadb

Before import search and replace dump file utf8mb4_0900_ai_ci to utf8mb4_general_ci

1
%s/utf8mb4_0900_ai_ci/utf8mb4_general_ci/g
1
ddev debug migrate-database mysql:8.0
1
ddev debug migrate-database mariadb:10.11

Upgrade DDev

1
curl -fsSL https://ddev.com/install.sh | bash

Check version

1
ddev --version

Integration with platform sh

https://ddev.readthedocs.io/en/stable/users/providers/platform/

1
ddev get ddev/ddev-platformsh

Setup DDev in existing WP Project

  • Comment out existing db settings in wp-config.php
  • Add to the below php to wp-config
1
2
3
4
$ddev_settings = dirname(__FILE__) . '/wp-config-ddev.php';
if (is_readable($ddev_settings) && !defined('DB_USER')) {
  require_once($ddev_settings);
}

Remove Ddev project

1
ddev clean <project>

Delete ddev project

1
ddev delete <project>.
This post is licensed under CC BY 4.0 by the author.