-
-
Notifications
You must be signed in to change notification settings - Fork 28
blog: Legacy projects with unsupported PHP/MySQL versions using DDEV #375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Please check the linter errors https://github.com/ddev/ddev.com/actions/runs/15283249253/job/42987518863?pr=375
And my comments (I didn't make a full review yet.)
public/img/blog/2025/05/museums-victoria-Di7WfLcrJ_I-unsplash.jpg
Outdated
Show resolved
Hide resolved
src/content/blog/legacy-projects-with-unsupported-php-and-mysql-using-ddev.md
Outdated
Show resolved
Hide resolved
src/content/blog/legacy-projects-with-unsupported-php-and-mysql-using-ddev.md
Outdated
Show resolved
Hide resolved
src/content/blog/legacy-projects-with-unsupported-php-and-mysql-using-ddev.md
Outdated
Show resolved
Hide resolved
src/content/blog/legacy-projects-with-unsupported-php-and-mysql-using-ddev.md
Outdated
Show resolved
Hide resolved
src/content/blog/legacy-projects-with-unsupported-php-and-mysql-using-ddev.md
Outdated
Show resolved
Hide resolved
src/content/blog/legacy-projects-with-unsupported-php-and-mysql-using-ddev.md
Outdated
Show resolved
Hide resolved
src/content/blog/legacy-projects-with-unsupported-php-and-mysql-using-ddev.md
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll check it out in action tomorrow.
BTW, this is a good candidate for a DDEV add-on https://github.com/ddev/ddev-addon-template
src/content/blog/legacy-projects-with-unsupported-php-and-mysql-using-ddev.md
Outdated
Show resolved
Hide resolved
src/content/blog/legacy-projects-with-unsupported-php-and-mysql-using-ddev.md
Outdated
Show resolved
Hide resolved
src/content/blog/legacy-projects-with-unsupported-php-and-mysql-using-ddev.md
Outdated
Show resolved
Hide resolved
Next I created the very small file `~/legacyphp/.ddev/docker-compose.db.yaml` in the same directory next to `config.yaml`: | ||
|
||
```yaml | ||
services: | ||
db: | ||
platform: linux/amd64 | ||
build: | ||
args: | ||
BASE_IMAGE: ddev/ddev-dbserver-mysql-5.5:v1.24.6 | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an interesting workaround you discovered, but it's going to work only until the next ddev restart
:
Failed to start legacyphp: unable to start project legacyphp because the configured database type does not match the current actual database. Please change your database type back to mysql:5.5 and start again, export, delete, and then change configuration and start. To get back to existing type use 'ddev config --database=mysql:5.5' and then you might want to try 'ddev debug migrate-database mysql:8.0', see docs at https://ddev.readthedocs.io/en/stable/users/extend/database-types/
I think we can probably inject platform:linux/amd64
for MySQL 5.5, 5.6 on arm64.
I opened this issue:
But I don't think we're going to implement this fast.
I propose to add a small note on this matter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oooh, shoot. That is unfortunate - I honestly only had to start it up once and left it open for some days, and never issued a restart. I wonder if this makes the whole point of the article moot now, if we do not have a way to re-execute the container.
So I'd possibly scrap the whole article now, if you don't see any other kind of workaround to bypass the database config.yaml assignment/validation. If we had an YAML option like "disable_validation" or so that would massively help of course...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can try to:
- copy-paste
db
service from.ddev/.ddev-docker-compose-base.yaml
(replaceuid
value with${DDEV_UID}
,gid
value with${DDEV_GID}
, but I don't know if it'll work in this context; if it doesn't work, leave it as it is with a note that people need to update these values.) - copy-paste
.ddev/.dbimageBuild/Dockerfile
to.ddev/mysql55/Dockerfile
(or another folder) and updatedb
>build
>context
with new folder location. - Use
ddev config --omit-containers=db
which addsomit_containers: [db]
to.ddev/config.yaml
If the db
service name doesn't work, use a different one.
(I haven't tried this. but I think there is a good chance it's going to work.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm... I'm a bit afraid this "kills" the lightweightness the solution had before... I'm not so sure this would be a solution we should highlight as a blog entry then?
I would be okay to leave this blog entry dangling, if a ddev release allowing to influence the behaviour could be done at some point. Then we could add an info about the version requirement to the entry.. I am not in a hurry to publish this, but I also don't want to blow up the complexity too much.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let’s put this PR in draft.
(No new releases this month or next while Randy is bikepacking.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found a workaround for this.
src/content/blog/legacy-projects-with-unsupported-php-and-mysql-using-ddev.md
Outdated
Show resolved
Hide resolved
src/content/blog/legacy-projects-with-unsupported-php-and-mysql-using-ddev.md
Show resolved
Hide resolved
src/content/blog/legacy-projects-with-unsupported-php-and-mysql-using-ddev.md
Outdated
Show resolved
Hide resolved
src/content/blog/legacy-projects-with-unsupported-php-and-mysql-using-ddev.md
Outdated
Show resolved
Hide resolved
src/content/blog/legacy-projects-with-unsupported-php-and-mysql-using-ddev.md
Outdated
Show resolved
Hide resolved
src/content/blog/legacy-projects-with-unsupported-php-and-mysql-using-ddev.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Stanislav Zhuk <[email protected]>
(thanks so much for the effort of going through the article and finding good improvements to it!) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check the entrypoint
I added.
If we decide to change some logic for MySQL 5.5 and ARM64 in the future, the blog can be modified.
src/content/blog/legacy-projects-with-unsupported-php-and-mysql-using-ddev.md
Show resolved
Hide resolved
src/content/blog/legacy-projects-with-unsupported-php-and-mysql-using-ddev.md
Outdated
Show resolved
Hide resolved
…l-using-ddev.md Co-authored-by: Stanislav Zhuk <[email protected]>
…l-using-ddev.md Co-authored-by: Stanislav Zhuk <[email protected]>
That looks like a clever and valid way to circumvent it, and is lightweight. That works for me! I've added a small note to explain this, what do you think? Thanks so much for going the extra mile on it :-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added a small note to explain this, what do you think?
I don't see it. Please add it and modify the pubDate
(let's publish it on Monday or today).
Everything else looks ready.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
When you decide to write another blog, use a branch name other than main
. It lets you work on multiple articles in parallel and makes review easier.
Thanks a lot for the help. Yes, I noticed too I forgot to create a branch first. Will keep it in mind :-) |
The Issue
I was encouraged through https://discord.com/channels/664580571770388500/1374723890500337724/1375138791278379084 to contribute my solution as a blog article.
How This PR Solves The Issue
I have documented my steps to the best of my knowledge.
Manual Testing Instructions
Run
npm run build
to see the article.Automated Testing Overview
Only content, no changes of code.
Related Issue Link(s)
https://discord.com/channels/664580571770388500/1374723890500337724/1375138791278379084
Release/Deployment Notes
"Works on my machine". ;)