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

Anthony Hind
Anthony Hind
5,715 Points

move wordpress from one local server to another

Ok so I have WordPress installed on xammp on my PC and would like to transfer a WordPress site that I am working on to mamp on my mac book pro. I have copied all the files from one location to another and exported the database. When I created the original install I used the wp_wordpressSite table prefix. I cannot figure out how I can configure my database to be the same on the mac with the wp table prefix used can anyone help

6 Answers

James Barnett
James Barnett
39,199 Points

In general when migrating a database you need both the schema and the data. I'm guessing you need to import your schema. But I haven't done any Wordpress stuff yet, so I'm not exactly sure.

On another note, situations like are why VMs were invented. To move a VM like say a Turn Key Linux's LAMP virtual appliance all you would have to do is copy 3 or 4 files and you'd be done.

To transport a database, you only need to dump it and reimport it into another database. The prefix is set by the WP install. You'll need to set the $table_prefix variable in wp-config.php but that's it.

Anthony Hind
Anthony Hind
5,715 Points

That's what I thought I have literally exported and reimported but there is a large dump of information and then the login and out is at the bottom I will try and get some more info together and post shortly thanks guys

if you're on a Mac, I use Sequel Pro for most of my MySQL operations. It's far easier than manual and far more secure than installing PHPMyAdmin on your server.

James Barnett
James Barnett
39,199 Points

Paul Graham - So it's like MySQL Workbench but there's only a Mac version of it?

Probably. I've not used Workbench myself. It basically allows you to do standard MySQL operations over SSH or a socket.

Anthony Hind
Anthony Hind
5,715 Points

Cheers Paul,

Thanks for the link I will take a look, Do you work much with Wordpress and the moving of databases ??

after the WP install on the install step2 page I get a load of the follwing

WordPress database error: [Table 'digitalwindows.wp_digitalWindowsusers' doesn't exist] CREATE TABLE wp_digitalWindowsusers ( ID bigint(20) unsigned NOT NULL auto_increment, user_login varchar(60) NOT NULL default '', user_pass varchar(64) NOT NULL default '', user_nicename varchar(50) NOT NULL default '', user_email varchar(100) NOT NULL default '', user_url varchar(100) NOT NULL default '', user_registered datetime NOT NULL default '0000-00-00 00:00:00', user_activation_key varchar(60) NOT NULL default '', user_status int(11) NOT NULL default '0', display_name varchar(250) NOT NULL default '', PRIMARY KEY (ID), KEY user_login_key (user_login), KEY user_nicename (user_nicename) ) DEFAULT CHARACTER SET utf8

any idea what I'm doing wrong!

Well your error says the table doesn't exist. I'm not sure by the error whether that means the database also doesn't exist. My guess is you've got a slight misconfiguration with the prefix or database. Use a tool to check those databases, make sure the new one is showing up the same as the old. It could have been an incomplete or bad export or import.

Zac Gordon
STAFF
Zac Gordon
Treehouse Guest Teacher

Hi,

The databases should work the same on both systems. When you import the old database into the new one, does it properly load all of the content. All of the tables will automatically have the same prefix as on the previous server setup.

+1 for Sequel Pro

Anthony Hind
Anthony Hind
5,715 Points

Hi Zac, Paul

I have never seen this error either and I have moved wordpress sites like this before but this is the first time I have ever have the wp_ prefix involved as when practising I have always just used default settings!

Yes it successfully loads the imported data but for some reason it is not recognising the wp_digitalWindows prefix that I have used. I have deleted all of the install on mamp and set everything up again but the same error is happening one thing I did notice was I had used digitalWindows as my table prefix but in the wp-config file it shows as a lower case digitalwindows but when I try and use that method it completely loses all connections!

Very strange i'm convinced it something simple I am missing but i'm stomped too...

Cheers

Anthony

Are you sure the prefix isn't wp_digitalWindows_ ?