-
Notifications
You must be signed in to change notification settings - Fork 22
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
Studio: Allow import of wp-config.php #455
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.
I tested it and I confirm it works as expected.
Importing the wp-config file.
@@ -65,7 +66,7 @@ describe( 'LocalValidator', () => { | |||
'app/public/wp-admin/wp-admin.php', | |||
'app/public/wp-admin/about.php', | |||
'app/public/wp-includes/test.php', | |||
'app/public/wp-content/wp-config.php', |
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.
Nice!
Co-authored-by: Antonio Sejas <[email protected]>
@kozer I am concerned about the comment by @wojtekn ( p1723457289097709/1723450926.132199-slack-C04GESRBWKW ) If someone is using MySQL instead of SQLite, copying the wp-config file entirely will overwrite the DB credentials. If we want to prevent that we could read the imported wp-config and update the existing wp-config while excluding the db credentials. You could put the imported wp-config at a temporary location accessible by wp cli and then list the options and update the existing wp-config from that list, skipping the DB options. Or, we accept that importing on a MySQL Studio site will break the connection. What you think? |
@jeroenpf , I meanly merged it to resolve https://github.com/Automattic/dotcom-forge/issues/8625#issuecomment-2286095643 |
It's a great question. Not only for the the credentials but for other custom code that could live in wp-config.php I think we should not allow importing sites into MySQL sites or in the other hand we need to create another importer that will execute the correct wp-cli commands and all the other differences.
It's also worth mentioning that users accept a modal to replace all the files and database. |
Yep, I agree. When I was exploring https://github.com/Automattic/dotcom-forge/issues/8606, I also thought we should disable import/export for sites using MySQL (p1723104840771259/1723043486.040399-slack-C04GESRBWKW) as it seems the best way to go until we give support. I can open a PR with the fix. |
Fixes https://github.com/Automattic/dotcom-forge/issues/8661
Proposed Changes
When a user has a custom table_prefix, this is not currently respected, as we ignore
wp-config.php
file.This PR solves that.
Testing Instructions
wp-config.php
file, and ensure that you see the correct$table_prefix
.Pre-merge Checklist