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 Local WordPress Development Local WordPress Development Migrating WordPress from Local to Live Server

Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 91,253 Points

When migrating WordPress to cPanel

A couple of things....

I did notice that in the video when adding the database information on cpanel that there was a prefix to the database and username that could not be changed... migratew.

  1. Is this the same for all migrations?
  2. Does Wordpress know when you're importing database information?

Secondly, at minute 4 when we're updating the config file, I wonder why wouldn't we update the rest of the information... the password and host from local host but the username and password is important?

Thanks. :)

1 Answer

Colin Marshall
Colin Marshall
32,861 Points

cPanel seems to force the prefixing in my experience. If your host uses something other cPanel, or you're setting everything up yourself on a VPS, then you will likely have more freedom with database usernames and database names.

As for if WordPress knows when you are importing database information, I would say the answer is no. The only way it would know is if you were importing from the WordPress backend, and not from phpMyAdmin. That really isn't important though. For the most part, WordPress doesn't really do anything unless you try to access/load a page on the site. So whatever actions you take on the database outside of WordPress will go unnoticed by WordPress until you load a page and try to access something that was changed in the database.

Hope that helps!

Jonathan Grieve
Jonathan Grieve
Treehouse Moderator 91,253 Points

Cheers. :-)

A lot of importing and exporting requited them to make sure things match up. It's got to be worth then making sure you do most of your development before going live? Or am I overestimating how much needs to be done?

What about the config file? :)

Colin Marshall
Colin Marshall
32,861 Points

There are tools out there that make exporting/importing a breeze. The one I use is Wordmove and it is free but it requires use of the command line. You can sync any combination or all of the following: themes, plugins, uploads, database, and the WP core. You can also sync to as many environments as you want (staging, production, etc.). It works best if you have SSH access on your host.

As for changing the config file like you asked in the original post, you might as well change everything at once, but you only need to do that one time on each instance/environment of your site.

Jonathan Grieve
Jonathan Grieve
Treehouse Moderator 91,253 Points

Thanks. Just with the config file, the details are bound to be different for each environment, or again, am I overcomplicating things... you don't need to keep copying over the config file when I'm migrating back and forth. I know how obvious this probably sounds. :)

Thanks for your help!

Colin Marshall
Colin Marshall
32,861 Points

Correct, you don't need to keep copying the config file back and forth on migrations. It will be different for each environment and should pretty much stay the same after you have that environment up and running. The WP core also doesn't really need to be migrated each time, just make sure you have the same version (the latest version in most cases) installed between the different environments.