Boost Posted May 31, 2023 Posted May 31, 2023 Hey, What is your strategy for local development? For example, if you're converting a WordPress website to ProcessWire - let's say the website is acme.com - do you set up your development web server to use acme.com using the 127.0.0.1 trick?
cwsoft Posted May 31, 2023 Posted May 31, 2023 @BoostGuess you talk about converting WordPress site to PW site - right? Would just develop as usual using localhost for the new PW site and then just upload stuff to the server once ready. Usually I have three site/config.php files (config.php, config_server.php, config_local.php) which just differ in the DB credentials and the root host. Once my localhost PW site is up and running, I zip it (.htaccess, index.php, site/ and wire/) and upload the zip file to my server via Ftp together with a simple PHP unzip script. Then I run the unzip script on the server. Than I cooy/rename site/config_server.php to config.php). Last step is to enter my server PhpMyAdmin and just delete old DB tables and import the sql dump from localhost. 1
Boost Posted June 1, 2023 Author Posted June 1, 2023 Interesting. This is the first time I read about having three site/config.php files. If you could give me more details about this approach, it would be great.
bernhard Posted June 1, 2023 Posted June 1, 2023 There's this: https://processwire.com/talk/topic/18719-maintain-separate-configs-for-livedev-like-a-boss/ And this: https://github.com/processwire/processwire/pull/267 2
bernhard Posted June 1, 2023 Posted June 1, 2023 20 hours ago, Boost said: What is your strategy for local development? For instance, when you're converting a WordPress website to ProcessWire - let's say the website is acme.com - do you set up your development web server to use acme.com using the 127.0.0.1 trick? I'm using DDEV, so every project has it's own URL like myproject.ddev.site https://processwire.com/talk/topic/27433-using-ddev-for-local-processwire-development-tips-tricks/ That works great for PW but not sure if that also works for WordPress as I heard it does weird things with hardcoded hosts all over?!
aagd Posted June 1, 2023 Posted June 1, 2023 7 minutes ago, bernhard said: That works great for PW but not sure if that also works for WordPress as I heard it does weird things with hardcoded hosts all over?! About handling the hardcoded URLs in WP, there was this: WordPress sucks and I want to kick you in your teeth! - Page 5 - Beer Garden - ProcessWire Support Forums I'm still using MAMP PRO with .local URLs. It has it's limits, eg. with the choice of DBs, PHP versions etc. I guess I'll switch to DDEV, too, one day...
cwsoft Posted June 2, 2023 Posted June 2, 2023 For WordPress sites I used the Plugin Better Search Replace to replace hardcoded Urls when transferring Sql dumps from localhost to my live server and vice versa. For other CMS I just opened the Sql dump in Notepad++ and did a search/replace of Urls to match right host. 1
dotnetic Posted June 2, 2023 Posted June 2, 2023 On 6/1/2023 at 11:30 AM, aagd said: I guess I'll switch to DDEV, too, one day Do it now! It is easy to setup, and once you have it, you will never want to touch something other again. 1
Recommended Posts