Closed Syncriix closed 2 years ago
@Syncriix Thanks for the detailed report and discussion via our chat room too :)
So, the first thing is there was a bug in the wp-config.php files being installed for staging/dev sites, now fixed:
Ref: https://github.com/littlebizzy/slickstack/blob/master/modules/wordpress/wp-config-dev.txt Ref: https://github.com/littlebizzy/slickstack/blob/master/modules/wordpress/wp-config-staging.txt
...they were using the same database as production, without the suffix _staging and _dev they were supposed to use.
However, the bigger fix here is that we've changed to using new database names for staging/dev sites that are now hardcoded to be named "staging" and "development" and cannot be changed. This serves a few purposes like:
So going forward, the ss-install setup wizard will ask users what they want to name the production database, and the default name will now be "production" instead of "wordpress"...
So by default, SlickStack now has only 1 MySQL database called "production" unless the sysadmin enables staging/dev sites in which case there will be 3 MySQL databases installed to the server. Later if they want to disable staging/dev then they can easily delete those extra databases without worrying about doing janky surgery on the production database.
There was also a similar bug in ss-install-mysql-database
as well, now also fixed:
Ref: https://github.com/littlebizzy/slickstack/blob/master/bash/ss-install-mysql-database.txt
This script is now hardcoded to create databases "staging" and "development" only if staging/dev sites are enabled. However, the name of the production database depends on ss-config settings.
Thanks for the quick fix! I will test and confirm tomorrow and close the issue
I will close out this Issue but just FYI there might still be a few of our bash scripts that need more "if statements" to ensure certain tasks are only being run if DEV_SITE
and/or STAGING_SITE
are enabled.
But for now the OP's conflict is resolved.
By the way for any future Googlers, SlickStack will never delete the "staging" or "development" databases under any circumstances to avoid data loss, even if you enabled, but later disabled, those sites.
Steps to reproduce:
dev.domain.tld/?page_id=4
in my case) [Pic 1]domain.tld/?page_id=4
) [Pic 2]Ref: Pic 1
Ref: Pic 2
![image](https://user-images.githubusercontent.com/25897271/133138754-6af2e8eb-7e1e-40f0-acdd-fa6ddd6c4000.png)
I guess it might use the same database by mistake?