Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

Launch WordPress from Localhost

RESOLVED: Check comment below for solution if this happens to you!

Hi,

I've been following the Create a WordPress template tutorials and have begun the last step, Launching a WordPress Site. Unfortunately, this step is not going as easily as the video describes.

I have had my domain and hosting through ASmallOrange, where I've had a small blog created using a free template in place for a few months. After creating a new template using the tutorials, I'm attempting to migrate the new blog to the same URL.

What I've done so far:

1) I Backed Up WordPress files and databases for my old (live) blog AND my new blog (localhost).

2) Using SFTP through FileZilla, I removed the old WordPress installation (wp-content, wp-admin, wp-includes... etc.) from my public_html directory.

3) I Edited the localhost wp-config.php file to define the WP_HOME and WP_SITEURL values to my URL without a sub-directory.

4) Using cPanel, I created a new mySQL database and added a new user to the database.

5) I Edited the localhost wp-config.php file to define the DB_NAME, DB_USER, DB_PASSWORD, and DB_HOST ("localhost") values to the newly created mySQL database.

6) Using cPanel, I created a new FTP account with the directory set to "home/myusername/public_html" and gave them full privileges as instructed during the "Preparing to Manually Install WordPress" tutorial.

7) Using FileZilla, I successfully connected to the new FTP account and found no files or folders at the "/" directory of the server. I then transferred the WordPress installation files from my localhost backup (excluding the .sql database file) onto the "/" server directory.

8) Using PHPmyadmin, I successfully imported the .sql database file from the localhost backup into the newly created mySQL database.

Now here is the problem. When I navigated to my url, the layout was completely broken, and none of the content (posts, media, etc) or settings (plugins, custom fields, etc) were present in my WordPress dashboard. It seemed like the files and database had been successfully migrated, but none of this was being recognized by WordPress.

SO, I tried repeating steps 3-8 above, basically deleting the WordPress installation files using FileZilla, creating new mySQL databases and usernames, editing the wp-config.php and reattempting the FTP transfer and database importing.

Each time I did this (three times), after navigating to the URL in my browser, the install WordPress wizard page displayed, asking me to install WordPress, which I did, again finding the same issues of broken layouts, no content or plugins (after activating the template- it wasn't even activated). Apart from some visual styles loading from my main stylesheet, it appeared as a brand new WordPress installation. No amount of database files dropping/importing helped. Changing the permalink settings in the WP dashboard had no effect either.

What am I doing wrong here?

I am not getting a database connection error and I've triple-checked my wp-config.php settings, database names, passwords and FTP account settings. They all match each time.

Something to note:

-The first time I imported the .sql database files into the new mySQL database, the files all had a "wpWPP_" prefix, but the following attempts all had a "wpwpp_" prefix. I noticed that WHEN the database had files with "wpwpp_" prefixes AND THEN I went through the initial WordPress installation at "url.org/wp-admin/install.php" there were then two sets of files in the database, ones with "wpwpp_" AND ones with "wpWPP_" prefixes. It seems as though WordPress was ignoring my database files and installing it's own. To confirm this, I dropped the new "wpWPP_" files from the table and navigated to my URL, which again had a fresh WordPress installation page.

Please help me identify where I've gone wrong and how I can solve this. I know this is a long post, but it seems to me like all the work I've done designing and developing the new site is for naught. Thank you.

2 Answers

So I found out that it was an issue with the database table prefix being changed somewhere along the migration from the localhost. My localhost WordPress installation had been using a database prefix of "wpWPP_" but I think that the plugin (BackUpWordPress) that I used to download the local files and database .sql file, changed the wp-config.php file to look for "wpwpp_" prefixed.

All it took was editing the

/**

  • WordPress Database Table prefix. *
  • You can have multiple installations in one database if you give each a unique
  • prefix. Only numbers, letters, and underscores please! */

$table_prefix = 'wpWPP_';

TO

/**

  • WordPress Database Table prefix. *
  • You can have multiple installations in one database if you give each a unique
  • prefix. Only numbers, letters, and underscores please! */

$table_prefix = 'wpwpp_';

and voila! WordPress began to recognize the database table files and all of my problems went away. I did encounter an error when trying to login to wp-admin though:

"You do not have sufficient permissions to access this page."

Which I was able to fix through some changing of the wpwpp_usermeta table values located in the .sql database backup. Change the prefixes there to match the correct prefix and this goes away.

Here are some discussions talking about this problem, which is fairly common.

http://wordpress.org/support/topic/admin-problems-after-moving-wordpress?replies=2#post-750300 http://beconfused.com/2007/how-to-solve-you-do-not-have-sufficient-permissions-to-access-this-page-in-wordpress/ http://wordpress.org/support/topic/wp-admin-you-do-not-have-sufficient-permissions-to-access-this-page

Hope this helps anyone experiencing the same issues.

Wayne Fonseca
Wayne Fonseca
7,796 Points

Hi Seth Kearney-Caldwell,

Thank you, i faced the same issue, but for me it was this that solved it

$table_prefix  = 'wpwpp_';

Also for the "You do not have sufficient permissions to access this page." issue found at the wp-admin, I solved it by replacing everything to follow wpwpp_ in the sql file. That solved the issue. Also