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 trialWilliam Guth
1,570 PointsMigrate from Live to Local
How does one migrate from Live to Local? Opposite of what this video demonstrates. I have had the site up live while following along with this course track, and just now learned how to set up and run MAMP. So how do I bring my live site files down into MAMP locally to work on it?
5 Answers
Simon Duchaine
14,441 PointsYou need to create a new wordpress instance in MAMP and then reimport your SQL database and copy your wp-content folder and all it's content.
Also, you'll need to edit the wp-config.php file to ensure that it points to your correct SQL database credentials.
You'll need to change all you URLs in the database (if not your media files and other links will be broken) by using a plugin like Better Search Replace (https://wordpress.org/plugins/better-search-replace/).
Here's the complete guide. https://codex.wordpress.org/Moving_WordPress
Jacob Mishkin
23,118 PointsI would suggest you use the plugins; migrate DB pro, which is a paid service, or use all-in-one migrate which is free but limits you on the size of the site.
mind you, you will need access to the backend of the live site.
Laryssa Kwoczak
750 PointsI'm also trying to do this. I exported the WP database and copied my website's files into the local server folder. I imported the database files into PHPMyAdmin but am getting the following error message when I add my website and localhost information to SQL:
MySQL said: Documentation
1146 - Table 'mywebsite.wp_options' doesn't exist
Jacob Mishkin
23,118 PointsPlease look into the plugin: use all-in-one migrate. This will solve your migrating issues.
Laryssa Kwoczak
750 PointsThanks, Jacob! That did make it easy to migrate my site. There is just one problem. Most of the images are not appearing, but some are. Do you happen to know how I can fix that?
Simon Duchaine
14,441 PointsCheck your images URL. Maybe you'll need to run a search and replace plugin on your wordpress site.
Jacob Mishkin
23,118 PointsThere could be several issues.
are theses new images?
did you clear the cache?
did you look a the dev tools, and view the image? are you having console errors.
Laryssa Kwoczak
750 PointsI ran a search and replace and the image URL appears to be correct. Is there anything else I would have to do?
Simon Duchaine
14,441 PointsSimon Duchaine
14,441 PointsIn a way, it's the same thing than moving from local to live. You just need to find a way to FTP to your live environment to extract your WP-CONTENT folder and find a way to export your SQL database.
Maybe you could also use the EXPORT tool in the tools menu. (http://www.wpbeginner.com/wp-tutorials/how-to-properly-move-your-blog-from-wordpress-com-to-wordpress-org/)
William Guth
1,570 PointsWilliam Guth
1,570 PointsOK, so I export the SQL database from my live site and import to my local folder structure? Then bring the wp-content folder and its content from the live site to the local folder structure? Then update the wp-config.php file?
Got an error while trying to import the database. "You probably tried to upload a file that is too large. Please refer to documentation for a workaround for this limit."
It would make sense for Treehouse to demonstrate the reverse, seeing as the course begins with setting up a Wordpress site online. Alternatively, they could've began with the MAMP/XAMPP workflow, then went into the relationship between the local and live server.
Feeling bummed, and defeated.
Simon Duchaine
14,441 PointsSimon Duchaine
14,441 PointsHey William,
You've pretty resumed the migration process.
The problem with the SQL database import is because of some server or wordpress configuration (even if you use MAMP, some default config dissalow importing large file).
You can still import a large SQL database using some command lines : https://tommcfarlin.com/importing-a-large-database/.
Also, here's how to change the default config for importing a large SQL using PhpMyAdmin in MAMP : http://www.fatheaddesign.com/808/importing-large-sql-files-into-phpmyadmin-under-mamp/