I recently built a new theme for this blogging site. What I needed was to set up a beta website with live data. I did not want to have a beta site with dummy text. The reason for this was that I wanted all the plugins to work so I could see how my styling would work.
Today I will explain how easy it is to set this up.
Step 1 : Setting up your sub domain.
Get yourself a unique beta testing domain such as mybetasite.example.com, once activated upload the same copy of your WordPress you have on your live site, including all plugins and the current theme you are using. You can exclude the folder uploads located inside wp-content, as later you will see that all the images will be pulled directly from your live site.
If you’re using a new theme, temporarily change the name of the theme folder name in your beta site to match that of the live site. You can change this when you are going to upload the new theme.
Step 2 : Password protect your beta site
Always protect your beta site. Open up your original .htaccess file located inside your live site and make a copy. Before you upload your .htaccess file insert your needed text. If you don’t know what this is, or need to generate one. Simply use .htaccess password generator.
Once created upload the .htaccess and .htpasswd to the root of your beta site
Step 3 : Configuring your config.php file
Open up the config.php file inside your favorite editor and add the following two lines which will locally overwrite the url’s of the beta website. Don’t worry this will have no effect on your live site. This means that all links in your menu, permalinks etc… will have the beta url attached. Plus the most important reason is that the admin panel will be available to you from the beta site. If you don’t do this step every time you log in or click on a link, you will be redirected to the live site.
You can now start building your new theme with live content. Building a new theme with live content has lots of benefits, but if you have found this article you already know why you want to do this.
Once you have finished your new theme, change the name to a new theme name, so that you have a backup to the old version. Or simply upload the theme to an existing one. And hello presto activate it!