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

Jake Bolton
Jake Bolton
1,956 Points

MAMP and MySql

Hi Guys,

Sorry to throw this out there so close to Christmas, however I've been trying and failing to import a database from a live server to my localhost.

I've managed to set up the new site, and set up a new database, however I can't seem to import the pages/post content from the database.

The pages just don't seem to be there.

Could I be missing something?

Hope you could help guys.

Cheers, Jake

Kostas Oreopoulos
Kostas Oreopoulos
15,184 Points
  • I guess you imported the sql file into phpmyadmin. Correct?
  • If you did that, you have a set of new tables. Do they have content? (browse through phpmyadmin)
  • if yes, then look at the table names prefix and check in the wp-config that you had set the correct table prefix

2 Answers

Zac Gordon
STAFF
Zac Gordon
Treehouse Guest Teacher

Yeah, that's a good question. Can you see the new content in the database? For example if you go into the wp_posts table?

Jake Bolton
Jake Bolton
1,956 Points

Hi Guys,

Thanks for your answers. It's becomming clearer what the issue is here.

Since I imported my database content from the current live site on the clients server. I have three sets of table rows in the database.

'0_' 'wpCLIENTNAME_' 'wp_'

Basically, when I set the table prefix to 'wpCLIENTNAME' the site doesn't work.

If I set the prefix to 'wp_' the site works but doesn't pull any content in from the database. :-/

I've never come across this before as I never usually do this kind of operation.

Once again hope you can make some sense of this.

Many thanks, Jake

Kostas Oreopoulos
Kostas Oreopoulos
15,184 Points

sorry but i hope you could be more "algorithmic" than "narrative" in order to make sense (my guess is that you are trying to import into an existing wp site with different table prefix, which wont work like that, but lets make it more clear)

a) What is the name of the database? (it is listed in phpMyAdmin) b) click on your database and you will see a list of tables for that database. What is the name of the posts table it should be "something_posts"

if you have "somthing_posts" and "somethingELSE_posts" and "somethingNew_posts" then it obvious that you tried to "merge" two databases with different table names.

Try importting into a completly new database (empty) and then use that one.