The process is quite simple once you know the trick 🙂

  1. Make a copy of the web site folder structure
  2. Create yourself another folder at the root with the name of your Dev site
  3. Paste the content of the Live one we made into that new folder
  4. Make an export of the MySQL Database in SQL format, i love using “HeidiSQL” it’s easy and friendly use,
  5. Open the SQL file with a Text editor and locate those 2 lines :
    1. CREATE DATABASE IF NOT EXISTS `wp_DATABASENAME` /*!40100 DEFAULT CHARACTER SET utf8 */;
    2. USE `wp_DATABASENAME`
  6. Replace the value between the quote by the name of the new staging database
  7. In your favorite MySQL manager, create a new database with the same name with new credential as well
  8. Inject the SQL Script in the new Database
  9. In the new folder , locate the file wp_config.php and open it with your favorite text editor
  10. Modify the file to reflect the new credential and database name you’ve setup
  11. Back into your favorite MySQL manager, run the following Query to update the URL of the wordpress installation

update wp_options
set option_value = REPLACE(option_value,'myliveurl.mydomain.com','mystaging.mydomain.com')
where option_value like '%myliveurl.mydomain.com%'

Tagged with:  

Comments are closed.