How to setup existing Wordpress project on XAMPP - wordpress

I'm starting some work on an existing wordpress project on Github. Basically, the entire Wordpress install is on Github. I cloned it to my local XAMPP installation. What's the best way to get everything configured? I know I have to make a config file and get WP talking to my MYSQL database. I did that, and while I got the wp-admin stuff working fine, the front-side stuff isn't showing up.

In the database you need to update the links so that they point to your local host.
The way I do that is that I make a backup of the sql database and then replace everything like:
orig:
www.domain.com/site/...
with:
localhost/site/...
And then restore it

In 2020 it's perfect plugin to do this. It's called Duplicator. You need to install it and after it you have 4 steps to configure your installation on which machine it will be running. It's really easy to use, see this link:
https://wordpress.org/plugins/duplicator/

Related

Localhost works but refuses to connect on a particular project (ERR_CONNECTION_REFUSE) (WAMP)

this is my third question about the same project, so yes, i'm struggling.
I'm trying to manually import a wordpress site in local. We don't have access anymore to the dashboard (some bad stuff happenning), so i can't install a plug-in that migrate the site easily and automatically.
After having problems for linking the database with the site, i had PHP errors (continue targetting to break). Now i don't have php errors anymore but i can't access the site anymore.
I can go to localhost, it reaches it easily, i can go to my other projects, but it refuses to reach this particular project.
It says :
This site can’t be reachedlocalhost refused to connect.
Try:
Checking the connection
Checking the proxy and the firewall
ERR_CONNECTION_REFUSED
I've traveled on different forums to find a solution but i didn't find why it occurs only on one of my projects. The only difference i see is that the other projects use mariaDB and this one MySQL.
thanks for the help
Dude,
check local on flywheel its much simplier than wamp. Link:
https://localwp.com/
besides when migrating manually:
zip all ur files and download
install new wordpress in your local machine.
copy somewhere new wp-config.php and save it in different localization
paste and extract zip package in new wordpress localization on your computer
download database from wordpress you want to migrate on your local machine
replace wp-config.php which u extracted from files with your new wordpress instalation wp-config.php [ad.3]
it would be nice if u install wp-cli on your computer:link for windows:
https://www.ryadel.com/en/install-wp-cli-windows-wordpress-command-line-interface-how/
import database into your new wordpress and than run search replace in order to change migrating site domain name [use wp cli its easiest way]
to import DB:https://developer.wordpress.org/cli/commands/db/import/
to replace domains:https://developer.wordpress.org/cli/commands/search-replace/
remember that your DB need to be .sql and pasted in main wp directory
open terminal in main wp directory and write than wp-cli commands
If u re not familiar with terminal on windows I prefer gitbash / its easy to use adding linux commands and all sort of staff (always remember to open as administrator)
u can download here:https://gitforwindows.org/
after performing all this actions you can now log-in into wordpress on your local machine.
go to settings->permalinks and click save.
here you go u have finally migrated your site!
If you see 'error technical issues' you should also check ur file and directory permissions of wordpress.
here a link to correct permissions You can change with in gitbash terminal:Correct file permissions for WordPress

How to set up a WordPress site locally that was developed by someone else on Gitlab

I have a website that I designed and did all the frontend dev work. I then handed all my files over to my Wordpress developer. They built out the site and gave me access to the files on Gitlab. What I want to do is set up a local copy of the repo on my Mac (which I have done ), branch it and make some CSS changes to the site. Commit those changes and let the developer merge what I have done. I'm new to WP, so I haven't done much in the way of setting up a site. I've watched a couple of videos, but they all seem to be for someone who needs to download and install a fresh install of WP. I don't think this is what I want to do. I downloaded and installed MAMP, and set up localhost, tried to point it to my local repo on my Mac, but that's not working. I just can't find anything to point me in the right direction. Hoping someone here has some advice. Thanks in advance!
If I understand correctly, you've already cloned the site to your local and you've made a database in MAMP? And you've named them the same.
From there you should be able to pull up localhost:8888/databaseName and proceed with the WordPress install that you cloned. If this isn't working check to make sure that you cloned the project into the same directory that you specified when you set up MAMP. Still not working, check to see if you also cloned the wp-config.php file. Then go to the wp-config.php file and make sure the database specified is the correct database name and that username and password are "root". Still no? Make sure the table prefixes in the database are the same.
For background - usually when you install a fresh WordPress, the first screen you come to has you set up all this info. And, if you are cloning a project, usually the config file is in .gitignore since it is specific to where you are using it. 😀

Migrating site to wordpress

A client asked me to migrate a website to wordpress. The theme is made, everything is working fine locally and now im thinking the best way to make the migration. I'm thinking on makeing the instalation on a subfolder for testing and then moving it to the root of the server. Is there anything i need to do other than copy the files from wordpress folder to the root? Anyone know a good tutorial or a better way to make the migration?
Take a look at this tutorial from Sitepoint I'm always referring to it when I want to move WP websites and it works.
Example: yourlocalwebsite.com
Example: yourlivewebsite.com
Step 1 Upload you all local files or WordPress setup to the live server.
Step 2 Export your localhost database and edit it with notpad++ editor.
Step 3 find your local website name into notpad++ something yourlocalwebsite.com then go to replace tab and all replace tab your yourlocalwebsite.com with yourlivewebsite.com. now save it.
Step 4 check database name username and password into wp-config.php it should be correct which one you using live server database.
Step 5 go to you live database and take backup it then removes it and then imports your local database now.
Step 6 for making sure go to wp_options table and check the URL it should be now yourlivewebsite.com if not then change it
Step 7 go to wp-admin and set the permalinks to the post name
and check it is working fine or not.
local site comes properly but when we deploy same folder on server ... it shows broken pages
In order to migrate a Wordpress website you should
1. Copy your www folder using FTP Client (FileZilla, Fire FTP or WinSCP).
2. Export you database (important!) and then import the database in your new Web Hosting (Like OVH or other..).
Let me know if you have any others question !
Yes, you have to do lot more things than you specified.
Follow below steps :-
Download "Wp Migrate DB" plugin from https://wordpress.org/plugins/wp-migrate-db/ to your existing site
Open db migrator. When you will try migrating, it will prompt you to give folder path and website url for new site(old site is already filled by plugin so don't change them)
After adding folder path and URL start db migration
Copy files and folders from your local to live
Import migrated db to new database
Copy new credentials for db connect to wp-config file
Re save permalinks, as it may won't work after migration
After this you are all set to go...
Let me know if you need further assistance.
followed this tutorial and worked like a charm. Wordpress installation moved to the root of the server and everythig works fine. Themes and plugins. Just made the test right now.
http://www.inmotionhosting.com/support/edu/wordpress/329-move-folders
Thanks for the answers.

Using git with a PHPFog Wordpress app

I have cloned a copy of my PHPFog Wordpress app to my local machine. I then have a few themes im working on with there own sperate repository. So I copy and paste a theme into my Wordpress repository and then sync it back up with PHPFog.
This works all well and good.
However If I update my Wordpress app in the admin panel, and later on sync up some changes I have made I lose the update, and go back to the version of Wordpress I started with.
How are you supposed to correctly work with git and PHPFOG if every change you make on your Wordpress admin panel gets overwritten with every sync from your local machine.
Am I supposed to update Wordpress and then do another clone in order to have the correct version on my local machine before making new changes, and if that is the case how do clone the updated Wordpress app to my local machine.
Thanks
Your right, file system changes, that are made from the Wordpress admin, do not get added to your PHP Fog repo, and can get blown away on the next push.
A better way to handle this issue is to run your Wordpress installation locally on your development system like you hintted to. I use mamp for mac or wamp or xampp for windows to make changes in the Wordpress admin locally then check in and push those changes. This will let you see the results of your changes without effecting your production site. I think the time invested setting this up is well worth it.
To get this running you should install either mamp or wamp and install a fresh copy of wordpress in order to make sure mysql is running locally and the wordpress installation is able to connect. Then in a new folder clone a fresh copy of your repo and load that up in the browser. The url will be something like localhost:8888. It should fail to find the database but that is expected. You will need to configure your local environment variables (listed below) to point to the locally running mysql server. Look in the wp-config.php file of the fresh install for the database settings. Do not use the wp-config.php settings of your cloned repo. You do not want to make changes to wp-config.php file because those changes will get checked into the repo and it will break your production site after the push.
MYSQL_DB_HOST
MYSQL_DB_NAME
MYSQL_USERNAME
MYSQL_PASSWORD
Here is a great link that explains this process in more detail: http://docs.phpfog.com/getting-started/development

When migrating from a production server to a live one while using wordpress how should I go about doing this?

I am wondering if I can just export/import the SQL and then copy the folder to the new server or do I need to deactivate the plugins or how to do this? I don't want to mess up my current site in the production server just to find myself in a worse position.
I have been working with Wordpress for about a year now, and I haven't found an easy way to move the setup. You have to move the database, and you have to move the folder with all supporting files (uploads, etc). I would just use the export feature of wordpress to download an XML and then import it on your prod install. Move the folders via ftp.
Have you checked the "moving wordpress" official instructions?

Resources