6 steps to create local copy of your live WordPress site
1. Export your live database into an sql file.
2. Download/Copy your live WordPress site folder to your local machine.
3. Move your downloaded WordPress site files inside local server’s web root.
4. Open exported sql file using notepad or any other editor of your choice and replace “http://www.yoursite.com” with “http://localhost/wordpress” and Save that file. (CAUTION: This file could be very large so replacing might take time. Command for replacing file content on *nix based system.)
5. Import database from that sql file into your local mysql database.
6. Open wp-config.php file which you can find inside your copied WordPress folder. In that file replace DB_NAME with your local WordPress database which you imported in above step. DB_USER with database user name. DB_PASSWORD with database password.
That’s it you are done.
Troubleshooting
Blank page in browser?
- First disable All active plugins. Find out active plugins By executing following sql.
SELECT * FROM wp_options WHERE option_name = 'active_plugins';
- Copy contents of option_value column into safe place. This step is
required to keep backup of which plugins were active in order restore
them later.
UPDATE wp_options SET option_value = '' WHERE option_name = 'active_plugins';
Want to change user name and password of local WordPress site user?
- Execute following sql to list all the users
SELECT * FROM `wp_users`
- Look for user name inside “user_login” column for which you want to execute following sql also note down its “id” from “id” column.
-
Following sql will change user name and password of desired user.
UPDATE wp_users SET user_login=':user_login', user_pass=md5(':password') where id=:id;
In above sql replace following placeholders
- :user_login with desired user name
- :password with desired password
- :id with id you found in 2nd step
Comments
Post a Comment