How to Set Up a Development WordPress Site

If you want to redesign an already existing website in WordPress without taking the old website offline, you can create a development website in a separate folder on the server and migrate it later to the main url. Of course, you can also create a development environment locally on your own PC. But I like being able to test out the new site on different computers and different browsers.

[alert heading=”Step 1 | Create the Development Site” type=”alert-info” block=”true” close=”false”]Create a sub directory in the root directory of your website on the server called /wordpress.[/alert]

[alert heading=”Step 2 | Now Start Developing Your New WordPress Site” type=”alert-info” block=”true” close=”false”]Create the new WordPress site in the new subdirectory (directions for this to come later).[/alert]

How to migrate the new site when you are ready to launch:

[alert heading=”Step 1 | Make a Back-up of Your Development Files” type=”alert-info” block=”true” close=”false”]

Make a local copy of the development wordpress site files (I copied the files to my desktop).

Use FTP to transfer the files to a folder you have set up on your desktop or somewhere else on your computer. This takes a while so you can do Step 2 while you are waiting.

[/alert]

[alert heading=”Step 2 | Make a Back-Up of your Database” type=”alert-info” block=”true” close=”false”]

Back-up your current WordPress database

Use phpMyAdmin to export your database. (On the 1 & 1 dashboard choose “MySQL administration”)

Choose ‘export’ under the My SQL heading.

export-button

On the next screen highlight the database numbers, check the box ‘save to file’, Then press ‘go’.

make-copy-database

The SQL file will be downloaded to your download folder on your local PC, copy or move it to a safe place.

[/alert]

[alert heading=”Step 3 | Archive your old site’s files” type=”alert-info” block=”true” close=”false”]

Make a folder called oldsite in the root directory of your site. Copy the old site files to the oldsite folder. Then copy the files you backed-up in Step #1 to your home computer to the root directory of your site.

[/alert]

[alert heading=”Step 4 | Apply Database Migration Fix” type=”alert-info” block=”true” close=”false”]

Go to phpMyAdmin on your server. Select your database. Then select SQL. (Under the 1&1 logo you will see an icon with SQL in it next to the home icon.)

SQL-button

This will open a new query window. You are going to be making an SQL query on your database to change the root directory to where you are moving your newly developed WordPress website.

[/alert]

[alert type=”alert-info” block=”true” close=”false”]

Put this command in the query box:

UPDATE wp_options SET option_value = ‘http://www.stacyduval.com’ WHERE option_name IN (‘siteurl’, ‘home’)

Change ‘http://www.stacyduval.com’ to your new site’s location.

Press go. There will be 2 rows changed. Check to see. It makes you feel good to see that you have actually changed your database. If you see the message ‘0 items changed’ then see if you have made a typo.

affected-rows[/alert]

[alert type=”alert-info” block=”true” close=”false”]

If there are posts in your database do this query:

UPDATE wp_posts SET post_content=(REPLACE (post_content, ‘{old url}’,'{new url}’))

Replace {old url} and {new url} with your new and old site urls.

Example: UPDATE wp_posts SET post_content=(REPLACE (post_content, ‘http://www.stacyduval.com/wordpress’,’http://www.stacyduval.com’))

Again check to see how many rows were changed in your database to double check your work.[/alert]

[alert heading=”Step 5 | Update Permalinks” type=”alert-info” block=”true” close=”false”]

Login to the admin panel. Go to Settings and update the permalinks.

[/alert]

[alert heading=”Step 6 | Configure” type=”alert-info” block=”true” close=”false”]

Finally 301 redirect old urls to the new urls in the htaccess file. I put the 301 redirects in the beginning of the htaccess file after the # BEGIN WordPress

For example:

Redirect 301 /summercamp.php http://monicaashleydesigns.com/summer-camp

[/alert]

You are good to go!

My Techie Bio

Every six months I have to answer this question: “Describe your computer and web skills”. I have been involved in computers for a very long time now. Even before the internet was invented. This is my technical biography.

In the early 1960’s my Dad worked for IBM. He used to take me to work with him. I remember going in the gigantic freezing cold computer room with the IBM 360 and 3.75 megabyte disk drives that were taller than me.

My first two years of college were at Mills College where I was a math and computer science major. Lenore Blum was head of the department and she had received a grant from Washington D.C. to increase women in computer science. As a result, we had a direct line to the Stanford Pascal compiler. We were working on the first desktop computers including the Apple II. We had field trips to Silicon Valley. It was cutting edge. My first program was a gardening application.

Switching to UCLA for my junior and senior years involved switching majors to Economics and a less high-tech environment. I learned programming on a mainframe involving punch cards. One of the languages I learned was SQL, and I still have my college textbook. My first job out of college was as a data systems administrator for an accounting service bureau. I worked on a VAX mini-computer.

I worked at the New York Times in the 1980s (pre-internet) on a top secret special project to invent an electronic newspaper. (This was a VERY FUN job.) We were working on mini-computers still and designing our own proprietary dual processor. One of my jobs was to design the first electronic shopping product.

After the New York Times ended this project I went to work for Peat Marwick as an in-house systems analyst. I designed and installed computer systems for departments within their corporation headquarters in New Jersey and New York. I learned database programming here and used Foxbase for desktop applications and PACE on the WANG minicomputer. I built specialized applications for the distribution, partner’s meeting and legal departments.

Then I took a long break from computers when I went back to college to become a teacher. I have been a teacher for twenty years now. One day when I was teaching an eighth grade math class I knew I had to go back to school to catch up on the twenty years I had missed in the technology field so I could inspire my students to pursue technology degrees. I have been going to Santa Rosa Junior College to pursue my certification in Web Graphic Design. I am proficient in Adobe Creative Suite, HTML5, CSS3 and WordPress. I am learning JQuery and PHP.

Now I can’t believe I have a tiny computer that fits in my back pocket (my cellphone) with 64 gigs on it.

I am a private tutor and tutor students individually in all subjects from 3rd grade to college age. My favorite subjects to teach are math, reading and test prep (SAT, ACT, etc.) For exercise, I like to hike, ski and do yoga. Recently, I have taken up investing as an interest. Although I’m realizing that the investment field has changed a lot in the last ten years and has become so unpredictable that the average investor cannot trust pure economic indicators. It’s not for the faint-hearted and I can see why most people just hire someone to do this part of their life for them. I am also studying to become a Florida hemp industry flower essence practitioner. I have been obsessed with health and other esoteric things for a long time and am always trying to educate myself about our mysterious journey on this earth.