[SOLVED] Using WP locally from existing production not working, db differences, page not found
Posted by: seiferflo (---.fbx.proxad.net)
Date: April 03, 2013 01:36PM

Hi there,

Here's the situation.
I built a website long time ago, I need to make big edits and maybe update wordpress, but I'd like to have it locally.
I'm using WAMP as local server, I copied all the files and exported the db following wordpress's tutorial and I also tried using wp-dbmanager.
What happens is that my local website is half complete. It doesn't give me any db not found or something, but on the main page I get the error: The page you requested could not be found. Try refining your search, or use the navigation above to locate the post.

My menu and background is visible but it sounds like it's online (if I click a menu, it sends me to the online version of the website)

It took me 5min to do a similar operation with a Joomla website thanks to akeeba script and it's been 24h I'm trying to do it with wordpress. I couldn't find a simple backup solution which works properly with my version of wordpress. So I suspect it's because I don't have the proper wamp settings or the db in incorrect.

Online website is based with the following specs:
- WordPress 3.2.1
- Host: 1and1.com
- phpMyAdmin 2.6.4-pl3
- mySQL: 5.1.67
- PHP Version: 5.3.3-7+squeeze15
- Apache: no idea

Specs of the local one using WAMP 2.2e:
- phpMyAdmin 3.5.1
- mySQL: 5.5.24
- PHP Version: 5.4.3
- Apache: 2.4.2

As you can see the specs don't match. Yet I was able to import the db and get something.

- How to get the proper mysql, php and apache version? I can't find the exact match. I tried to get the Mysql, extract the files, then play with the *.ini file and add wampconfig to make it run with WAMP. Works fine for mysql but PHP gives an error.

- When comparing the online db and the imported one on the local version, it seems there are identical in terms of tables & records (size is a bit different though Online: 830.2 KB, Local: 852.7 Kicool smiley.

- I deleted the local wp-confip.php, let wordpress start the install and filed it with the followings:
DB_NAME : db382978911
DB_USER : root
DB_PASSWORD :
DB_HOST : localhost

What's the problem? Is it WAMP's fault or did I miss something?
Please help me I'm getting nuts.

Thanks in advance for your help
Best Regards,
Flo



Edited 4 time(s). Last edit at 04/03/2013 05:22PM by seiferflo.

Options: ReplyQuote
Re: Transfer from Online WP to local not working, db differences, page not found
Posted by: RiggsFolly (---.as13285.net)
Date: April 03, 2013 02:11PM

WP stores the site url in its database when you install it, and then uses that info in various places in its normal working.

You have to look through the _options table and edit the references to the live site into the test site

eg change [livesite.com] into [testsite.dev] for example

there are a few refrences in this table, more depending on what addons you may be using and what they save in there for themselves.

Options: ReplyQuote
Re: Transfer from Online WP to local not working, db differences, page not found
Posted by: seiferflo (---.fbx.proxad.net)
Date: April 03, 2013 03:01PM

Thanks for your feedback.
I actually opened the db.sql that I exported from the online website, replaced all the occuriences [website.com] by [localhost] (900 replacement)

It works great for the first page, however my menu links are incorrect.

I don't know much in WP, but it looks like this:
Online: http : //mywebsite.com/services
and locally it has been changed with http : //localhost/ftpfoldername/services and this gives "Not Found. The requested URL /ftpfoldername/services/ was not found on this server.
FYI /services/ is page in WP-Admin

Thanks in advance



Edited 1 time(s). Last edit at 04/03/2013 03:02PM by seiferflo.

Options: ReplyQuote
Re: Using WP locally from existing production not working, db differences, page not found
Posted by: RiggsFolly (---.as13285.net)
Date: April 03, 2013 04:21PM

Your best bet with WP is to create a Virtual Host, then it looks like a standard website and not a folder under a website.

Then install the correct version rather than copy files from live.
Then add that database to mysql
Then change the entries referencing the site ( or like you did cgange them in the .sql ) as long as you change then to the correct thing

Options: ReplyQuote
Re: Using WP locally from existing production not working, db differences, page not found
Posted by: seiferflo (---.fbx.proxad.net)
Date: April 03, 2013 05:21PM

Allright I found the problem. I had a problem with my permalinks

I had to launch phpmyadmin, go to wp-options and find 'siteurl' and 'home'
Change the values from http: //mywebsite.com to http: //localhost/folderftpname on both.

Launch http: //localhost/ftpfoldername/wp-admin
go to the admin page, dashboard->settings->permalinks->Common Settings and select "Default' (I was with a specific settings).

Quite a lot of images are not really working, but I'm done, it's too much of pain. I'll keep doing joomla websites, it doesn't give me as much pain.

Thanks for your help though, very appreciated (I was still waiting for a reply on wordpress forum...)
Best Wishes



Edited 2 time(s). Last edit at 04/03/2013 05:24PM by seiferflo.

Options: ReplyQuote


Sorry, only registered users may post in this forum.