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

Houston, I have a problem !!

I'm confused. When I make a 5 min Download WP installation I set up the database. Do I need to create a new database in Cpanel, or I can also carry transfer the data to the existing database? How do I should act?

3 Answers

Zac Gordon
STAFF
Zac Gordon
Treehouse Guest Teacher

Hi,

Are you trying to transfer an existing site or setup a new one?

Hi! I have set up the live site and local site. Yes, I am trying to transfer data to an existing site. Maybe the mistake is that I am on existing web site I try to create a new database?

Zac Gordon
STAFF
Zac Gordon
Treehouse Guest Teacher

I believe the video covers this but you would upload any files that have change, drop the live database and then upload the local db.

Hi Sandi,

I didn't watch the course, but i can guide you to the database migration part.

  • Export your database from your local machine.
  • Open the exported .sql file with any text editor.
  • Find and replace your local domain with your real domain.

For example:

Local domain: http://localhost/wordpress Real domain: http://YOUR-DOMAIN.COM

Now, in your text editor find http://localhost/wordpress and replace with http://YOUR-DOMAIN.COM

  • Save the .sql file after changes you've just made.
  • Go to your cPanel > Databases section & create new database.
  • Go to your phpmyadmin > choose database you have created.
  • Go to import tab > browse > choose .sql file and upload, then wait for it until you get the success message.

After that you need to change your database credentials within your wp-config.php file.

That's all :)