Tuesday, March 28, 2023

Migrate Wordrpess site into localhost using WAMP

About DB files

Open the db file and then:
Search replace:for example,
search replace the text https://dev-forward-content.pantheonsite.io with http://forward-content
then search replace dev-forward-content.pantheonsite.io with forward-content

Save the file and you may also zip it if it's too large.

Now, go to phpmyadmin and create a new db. Then, import the modified db.

About WP config

Open wp-config.php file and fill in the fields:

DB_NAME
DB_USER
DB_PASSWORD
DB_HOST
: (you may use "localhost" for this one)

About images and assets

Export all images inside /wp-content/uploads/ folder (u may create "uploads" folder manually if not available)

Once you import the db in your localhost:

1- Wampserver > Your Virtual Hosts > Virtual Host management
2- Fill the info:
Name of the virtual host: forward-content
Complete absolute path: c:/wamp64/www/forward-content
Leave the other one blank
Click "Start the creation.."
3-Run CMD type ipconfig /flushdns hit enter
4- Right-click Wamp>tools>Restart DNS

When you go to http://forward-content you'll see the site come up :) 

To import large sql files:

Click your Wamp server icon -> MySql -> MySql console
Once mysql console is open. Enter your mysql password. and give these commands.

use user_database_name
 
press enter

source c:/your/sql/path/filename.sql
 
press enter

Video:

No comments:

Post a Comment