• I downloaded my database and files from the FTP. Stuck the folder named Blog in htdocs. Created a database and imported my SQL file from my blog. I edited my config file accordingly and the options table in the database to reflect localhost. However, when I go to localhost/blog it’s like nothing exists and I have 404’s. Here’s what it looks like when loading the blog in Xampp.

    View post on imgur.com

    Anyone have some input as to how to load an existing WordPress blog in Xampp? TIA!

Viewing 12 replies - 1 through 12 (of 12 total)
  • …edited my config file…and the options table in the database…
    However, when I go to localhost/blog it’s like nothing exists and I have 404’s.

    If our resident expert might not happen to see your post and jump in here, here is what I have done in your situation:

    UPDATE pref_options SET option_value = replace(option_value, 'http://www.olddomain.com', 'http://www.newdomain.com') WHERE option_name = 'home' OR option_name = 'siteurl';
    UPDATE pref_posts SET guid = replace(guid, 'http://www.olddomain.com', 'http://www.newdomain.com');
    UPDATE pref_posts SET post_content = replace(post_content, 'http://www.olddomain.com', 'http://www.newdomain.com');

    note: Change above ‘pref’ to your own table_prefix and edit ‘http://www.olddomain.com’ and ‘http://www.newdomain.com’ as required.

    Then for reasons I do not understand, I seem to still also need this near the top of wp-config.php:

    define('WP_HOME','http://localhost/blog');
    define('WP_SITEURL','http://localhost/blog');

    Thread Starter The One

    (@the-one-1)

    I take it those are database queries? I’m not that good at SQL.

    Ah yes, and you have phpMyAdmin > SQL in Xampp. See here:
    https://wordpress.org/support/topic/page-not-found-after-migration?replies=8#post-7148582

    edit: I have also just remembered I have occasionally had to delete .htaccess and then re-save Dashboard > Settings > Permalinks to get pages working as they should.

    Thread Starter The One

    (@the-one-1)

    I did delete all of the contents in htaccess before trying to load the site in Xampp.

    I did delete all of the contents in htaccess before trying to load the site in Xampp.

    …and then re-save Dashboard > Settings > Permalinks after everything else has been done?

    Thread Starter The One

    (@the-one-1)

    I’m trying to run the quires and I’m getting syntax errors.

      #1064 – You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ”https://blog.systechforum.net/”localhost/blog’) FROM pref_options WHERE option_’ at line 1

    I edited my prefix to pref. Does the underscore need to be there? So would: UPDATE pref_options SET option_value = replace(option_value, ‘http://www.olddomain.com’, ‘http://www.newdomain.com’) WHERE option_name = ‘home’ OR option_name = ‘siteurl’;

    Be: UPDATE abcoptions SET option_value = replace(option_value, ‘http://www.olddomain.com’, ‘http://www.newdomain.com’) WHERE option_name = ‘home’ OR option_name = ‘siteurl’;

    ?

    I’m getting syntax errors…

    edit: Try removing the trailing slash: ‘https://blog.systechforum.net’

    would: UPDATE pref_options SET …

    Be: UPDATE abcoptions SET …

    Does the underscore need to be there?

    Yes, the underscore distinguishes the prefix from the table:
    ‘UPDATE prefix_options’ = ‘UPDATE abc_options’

    edit: Try removing the trailing slash: ‘https://blog.systechforum.net’

    Thread Starter The One

    (@the-one-1)

    Hi, sorry about the delay. I’ve been very busy.

    I have this to run as a query, but it seems the table doesn’t exist as the error says “Table ‘abc.abc_posts’ doesn’t exist ” My table is abc.

    UPDATE abc_options SET option_value = replace(option_value, 'https://blog.systechforum.net', 'http://localhost/blog') WHERE option_name = 'home' OR option_name = 'siteurl';
    UPDATE abc_posts SET guid = replace(guid, 'https://blog.systechforum.net', 'http://localhost/blog');
    UPDATE abc_posts SET post_content = replace(post_content, 'https://blog.systechforum.net', 'http://localhost/blog');
    Thread Starter The One

    (@the-one-1)

    I just changed the queries to:

    UPDATE aesoptions SET option_value = replace(option_value, 'https://blog.systechforum.net', 'http://localhost/blog') WHERE option_name = 'home' OR option_name = 'siteurl';
    UPDATE aesposts SET guid = replace(guid, 'https://blog.systechforum.net', 'http://localhost/blog');
    UPDATE aesposts SET post_content = replace(post_content, 'https://blog.systechforum.net', 'http://localhost/blog');

    That produced a Mismatch Token. So I found this: http://stackoverflow.com/questions/18358867/phpmyadmin-error-mismatch-token

    Now when I run the query I get “MySQL returned an empty result set (i.e. zero rows).”

    Thread Starter The One

    (@the-one-1)

    Okay, progress! I had to change the original link to HTTP instead of HTTPS. Then 18 rows were affected.

    But when I try to login or click a blog post I get the following error:

    “Object not found!

    The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.

    If you think this is a server error, please contact the webmaster.
    Error 404
    localhost
    Apache/2.4.12 (Win32) OpenSSL/1.0.1l PHP/5.6.8 “

    Also, the banner doesn’t show up. Basically clicking any link to go to a page produces the error. I have a felling there needs to be some other database tables edited.

    Thread Starter The One

    (@the-one-1)

    Just got this working now in Xampp. I changed the URL in my live site to the localhost path to Xampp and saved. Then I downloaded the SQL file again and loaded. Reran the quarries and then had to rest the permalinks like you mention. Since my htaccess was set to read only for some reason I had to copy/paste the htaccess code WordPress provided when I resaved the permalinks.

    When I did change my live site to the localhost Xampp domain I couldn’t log back in so I had to go into phpMyadmin in cPanel and set the URL back under the options table for siteurl and home.

    All seems to work now including plugins.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Getting WordPress and Xampp to work’ is closed to new replies.