How To Fix Your Wordpress AFTER You Move It

Recently, we changed how our client test server is set up in order to more accurately mirror the file structure for production websites. Our intent was to make things as easy as possible when making server migrations. So for instance, when we moved the file structure of a Zen-Cart into an iDotCart. But when we recently did this with a client’s Wordpress we broke it!

Oops….

After digging through some Google returns we didn’t find anything really very helpful. There was a lot of newbie kind of talk about copying and moving files on a Unix/Linux server, including the gotcha, “don’t forget to copy your .htaccess and index.php” files.

But there was no mention of configuration files where the file structure of the server and web files might need to be defined. There is wp-config.php which sets up the database variables, but there was no file where I needed to specify my http://domain.com or the path to the web files ie: /var/www/mydomain.com/httpdocs.

Then we stumpled on someone else’s post that said not to move your Wordpress installation until after you go into the wp-admin console and change the “site url and path”

Well…it would have been nice to know that ahead of time right?

Turns out that it’s not a big deal to fix with a couple lines of sql. Wordpress stores a lot of its configuration in a database, in fact, it stores all of its configuration EXCEPT it’s database connection in the database.

So let’s log into our mysql database and check out the Wordpress Database:

mysql> use wordpress;

And then look into the tables

mysql> show tables;
+———————–+
| Tables_in_wp_shamrock |
+———————–+
| wp_ads_banners |
| wp_comments |
| wp_links |
| wp_options |
| wp_postmeta |
| wp_posts |
| wp_term_relationships |
| wp_term_taxonomy |
| wp_terms |
| wp_usermeta |
| wp_users |
+———————–+
11 rows in set (0.00 sec)

SELECT * from wp_options;

Returns a lot of stuff that you probably wouldn’t even guess was in your database. So luckily, Dan, took the time to dig through this table and came up with this neat line of code to get you back to being able to access your wp-admin folder on the new server or in the new file structure.

UPDATE wp_options SET option_value=”http://yourdomain.com” WHERE option_name=”siteurl”;

Point your browser now to http://yourdomain.com/wp-admin and login.

Then go into your Admin –> Settings –> and change the WordPress address (URL) and Blog address (URL) to your new domain.

If this doesn’t work, send us a message or call iDotMind:

Toll Free: 1-866-491-0577

Written By Nestor Wheelock
Systems Architect and Client Support Guru
http://www.iDotMind.com
This article be freely shared non-commercially under the Creative Commons

Creative Commons License
How To Fix Your Wordpress After You Move It by iDotMind is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.

Bookmark and Share

© 2006–2009 iDotMind Internet Technology and E-Marketing — Sitemap

Website Template by iDotMind
Mobile Edition