Topic on Project:Support desk

Generate LocalSettings.php from an existing MW database (without removing it)

5
Toniher (talkcontribs)

Hello, I'm checking install.php maintenance script, and I'm wondering if there is any parameter/option/additional maintenance script via command-line for generating a LocalSettings.php file from an existing DB installation.

Thanks!

星耀晨曦 (talkcontribs)

In general, the configuration is not stored in the database. So, you can't generate a LocalSettings.php from an existing DB installation. Of course, you can also develop the corresponding extension to meet your needs.

2001:16B8:10F2:3400:8CCF:3FDD:68E3:7673 (talkcontribs)

I am not sure I understand: An existing installation will already have a LocalSettings.php file. So there is no need to recreate one - you can just copy it!

What do you want to achieve?

Toniher (talkcontribs)

In my case I'm working with Docker containers and LocalSettings.php is kept in the image/container and not mounted. If rebuilt a new image / run a new container, I want to generate a new LocalSettings.php mapping a DB that I'm not creating from scratch. I would dare to say what I am asking is actually possible via web interface. I'm wondering whether could be possible via CLI...

2001:16B8:10F2:3400:A150:F8BA:2A8F:73AD (talkcontribs)

I don't know docker enough: What are the differences between all the different images/containers, which you later can create?

Are they all completely separate in a way that they could e.g. always use the same DB name for example?

And apart from the database credentials: Should they be identically configured?

(Reading what you want to achieve, I think this must be kind of a standard usecase for docker...)

Reply to "Generate LocalSettings.php from an existing MW database (without removing it)"