Dummies Guide to setting up staging/test site in Wordpress

I’ve tried the Wordpress forum and Google searching to no avail, so I’m coming here as my last, best hope.

I’m using Wordpress (one-click, Advanced mode) on my site, www.touchwoodproject.com. I need to redesign it using a new theme but I need to change a bunch of posts, add some plugins, etc, so I can’t use plugins like Theme Test Drive because that just changes the look of the site but nothing else. I don’t want to take down my existing site while I make all these changes, so. How can I do this?

All the info I’ve seen (including using a plugin called Dev and Staging Environment) has you doing things like modifying the config file, but they don’t exactly specify how and I have no idea how I’d “ensure it has read and write privileges in the Wordpress root”. What?? I almost never use FTP and have no clue how PHP works or even what it really is.

Can anyone tell me a Dummies Guide to setting up a staging site so I can rework my site? Ever hopeful…

It sounds like you want to run parallel installations, based on your live version.

I would go with the following:
Restore your Domain (from the DH panel for Manage Domains) with a timestamped appended directory. Create a Fully Hosted SubDomain owned by the same user (again, from Manage Domains) and tell it to use the newly restored directory for the web directory (normally, it’ll prefill “/home/USER/SUB.DOMAIN.com,” so tell it “/home/USER/DOMAIN.com_TIMESTAMP”.

Restore your Database (from the DH panel for MySQL) with timestamped prepended tables. Edit your WP config.php to use the new table prefix.

Hi Scott! Hoping you are still out there. I followed your instructions exactly and have my test instance up and running perfectly with one exception. When I login to the WP admin using my subdomain, when I click login it redirects me to my main domain’s admin dashboard for WP.

What am I missing?

I didn’t think wp-admin could be tricked into bumping you to the main domain. Two ideas:

  1. When you go to wp-admin, it redirects you to wp-login, but look at the URL in your menu bar. There’a redirect flag tacked onto the end. Manually edit that to reflect your subdomain. It has some % characters, but I hope you can decipher it enough to fix the redirect URL.
  2. Use phyMyAdmin to connect to the database server. Browse the desired database and find the “blahblahOptions” table. Browse that table and the first entry is usually the Site URL. Edit that so it’s your subdomain.

I’ve done all of this, and now, I get the error:

ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.

when I try to load my subdomain’s wp-admin.php.

However, cookies are NOT blocked, and ARE supported by my browser.

I even tried moving my plugins directory for the subdomain to old-plugins, in case it was a plugin issue.

No luck. I can’t log into wp-admin for my subdomain.

try clearing your browser cache/cookies…or try a different browser maybe.

Did both. No luck. I did discover that there were some tables (options, usermeta) that needed some meta key names changed (there were several that used the live database table prefix, rather than the backup copy), and a few that needed their values changed to the subdomain rather than the live site’s domain.

Now I’ve gotten past the whole cookies problem, and am faced with WP claiming that my administrator account doesn’t have permission to access the admin panel when I try to login:

“You do not have sufficient permissions to access this page.”

EDIT: And, I fixed it. Turns out that editing database fields when sleepy creates problems, like not putting the extra trailing “_” in the new table names into the appropriate fields. Once I did that, I got in.

[quote=“sdayman, post:2, topic:53329”]
Create a Fully Hosted SubDomain owned by the same user (again, from Manage Domains) and tell it to use the newly restored directory for the web directory [/quote]

The control panel didn’t let me use the same user for my subdomain. I am using DreamPress…is that the reason why?

Dreampress has staging built in. It should already be available to you.

As I don’t use dreampress (yet), you should contact support.

Can someone type out these “Dummy Directions” in a manner better suited to dummies?

I tried restoring my main website with the timestamp thing, but I got an error that it took too long.

I currently have my main website and a subdomain. The subdomain is fully hosted, but has nothing on it. I want to copy my main site over to the test subdomain so I can test out plugins outside of my live environment.


I would like to know as well.

1st things 1st, you must back up your current site’s SQL database. You can consult this article to do so: https://help.dreamhost.com/hc/en-us/articles/215039758-How-do-I-backup-my-MySQL-database-

Once your SQL database is backed up & you have downloaded it completely to your hard drive, you have 2 options:

  1. Create a new SQL database
    (for example, if you’re trying to set up a virgin staging site, or want to manually copy files from your live site): https://help.dreamhost.com/hc/en-us/articles/221691727-Creating-a-MySQL-database

  2. Upload the database you just backed up to your computer, but give it another name
    (for example: stage, staging, dbstage, companystage, etc.)
    Sorry, I would have added a 2nd link, but apparently new users can only post 2 links at a time in messages. Try Googling: exporting/imorting SQL database Dreamhost. That should get you the articles.

In both cases, once this is complete, your database will exist but may not yet be connected to the subdomain. Hence, the need to configure the wp-config &/or functions.php file &/or other files.

All of your files can be found by going to your left-side panel Domains > Websites > & selecting My Files next to the proper/desired website. This is where all your folders live, where you can upload via ftp, edit, copy & paste into different folders, &/or modify your html, css, js, php, theme files, etc.

I am more familiar with C-Panel, which is the interface that 99% of websites use, so not sure why Dreamhost made it so complicated. I have literally spent an entire morning trying to figure out how to see my subdomain before I create the SQL database.

Hope this helps somewhat!