WordPress custom table prefix preventing staging site creation

Hello Guys

There was an error while creating a staging site through CyberPanel. There was a problem that when the master site have a different $table_prefix value in wp-config.php it was not working.

To rectify this problem. I’ve first fetched the table_prefix from master site here.

Then after the wp config file for staging site is configured, I’ve used wp config command to set this table prefix here.

On your CyberPanel installation this file is available at /usr/local/CyberCP/websiteFunctions/StagingSetup.py

So if you are a developer, you can use any editor to make improvements to this file and then run systemctl restart lscpd to apply those changes to take affect.

thanks.

4 Likes

:slightly_smiling_face:Good, can it be applied via the update because I am not a capable developer to apply the changes

Yes, if you just upgrade to v2.1.2 (or force update). The new code will take place.

@usmannasir. Excellent work following our conversation last week. I will update asap. I assume this will also resolve the issue with search and replace on the staging site?

Yes. Check and let me know

Thank You Sir
It is applied