Before start,
Note that if you use “WP-DB-Backup”, you can godhead backup your database by the plugin and jump to step 8.
just make sure you select every options there.
I has been testing many DB backup plugin for WordPress one or two times a year for 4-5 years since i start using wordpress, so far the best tool for me is still “WP-DB-Backup”. It is straightforward, dead simple and it’s always “work”. It is highly recommended.
Now, let’s start
1. create your “DB_NAME, DB_USER, DB_PASSWORD” just like you do a fresh install of WP.
2. Copy all of your wp-files from the live server to your harddrive.
3. open up wp-config.php(that you download from #2) and change infos in “DB_NAME, DB_USER, DB_PASSWORD” to match the new db you created from #1
4. log in to your site’s “phpMyAdmin”.
5. look for your live site’s db. see image below. mine is “_digitalmotive”. click on it.

6. It will open a new page with lists of you live site’s db table. At the lower part of the page, click on “Check All”, then “Export”

7. see image below, and click at “Go” button at the bottom of the page. and save the file on your computer.

8. Still at phpMyAdmin. click at “home” icon on the left column to go back, and select your staging db name. Mine is “lkafjdlksf”

9. click at “Import” tab, and import db file you from #7.
10. after import the db, go back home and select your staging db name again. this time you will see list of staging’s db table show up.
look for “wp_options” table, and click “Browse” next to it.
11. under “option_name” column, look for “siteurl” and click “Edit”. notice that it is your live site’s url there? change it to your staging’s url and save it. (if you developing site on local host using, you can use something like this >> http://localhost/location_of_your_site_directory)
12. now you should be able to go to your staging site, log in to your staging’s site using live site user name and password.
13. after log in to wordpress’s admin go to “Settings” > General > change “Site address” to your staging URL.
Done!
refer to : Changing the URL directly in the database