Local Community

How to migrate from MAMP to Local

Using Duplicator

  1. Make sure you’re on Local 1.4.1 or newer
  2. On your MAMP site install and activate Duplicator
  3. Go to Duplicator in the WordPress Admin and create a new “Package” that’s a full site backup
  4. Once the backup completes download the .zip (installer.php isn’t needed) to a safe space
  5. Open Local and trigger the import by doing one of these three things
  • Drag and drop the backup .zip onto the main Local window
  • Drag and drop the backup .zip onto Local’s Dock icon (macOS only)
  1. Continue through the import site steps
  • Note: Make sure the site domain in Local is different than what it is in MAMP!
  1. Done!

If anyone has any alternate ways they do this feel free to share!

Good instructions. The only thing in my case is that I Duplicator (free version) doesn’t support Multisites. I believe you have to use the Pro version if you want to execute the above steps with Duplicator.

@clay Dropping the .zip on Local works nicely indeed. But when accessing the admin, the screen is filled with error messages:

PHP Warning:  A non-numeric value encountered in /Users/username/Websites/enablement/app/public/wp-content/plugins/oxygen/component-framework/components/component.class.php on line 2245
PHP Stack trace:
PHP   1. {main}() /Users/username/Websites/enablement/app/public/wp-admin/admin-ajax.php:0
PHP   2. require_once() /Users/username/Websites/enablement/app/public/wp-admin/admin-ajax.php:22
PHP   3. require_once() /Users/username/Websites/enablement/app/public/wp-load.php:37
PHP   4. require_once() /Users/username/Websites/enablement/app/public/wp-config.php:77
PHP   5. do_action() /Users/username/Websites/enablement/app/public/wp-settings.php:525
PHP   6. WP_Hook->do_action() /Users/username/Websites/enablement/app/public/wp-includes/plugin.php:465
PHP   7. WP_Hook->apply_filters() /Users/username/Websites/enablement/app/public/wp-includes/class-wp-hook.php:310
PHP   8. Oxygen_Gutenberg->init() /Users/username/Websites/enablement/app/public/wp-includes/class-wp-hook.php:286
PHP   9. do_shortcode() /Users/username/Websites/enablement/app/public/wp-content/plugins/oxygen-gutenberg/oxygen-gutenberg.php:103
PHP  10. preg_replace_callback() /Users/username/Websites/enablement/app/public/wp-includes/shortcodes.php:199
PHP  11. do_shortcode_tag() /Users/username/Websites/enablement/app/public/wp-includes/shortcodes.php:199
PHP  12. CT_Section->add_shortcode() /Users/username/Websites/enablement/app/public/wp-includes/shortcodes.php:325
PHP  13. CT_Section->set_options() /Users/username/Websites/enablement/app/public/wp-content/plugins/oxygen/component-framework/components/classes/section.class.php:35
PHP  14. CT_Section->build_css() /Users/username/Websites/enablement/app/public/wp-content/plugins/oxygen/component-framework/components/component.class.php:2191
PHP Warning:  A non-numeric value encountered in /Users/username/Websites/enablement/app/public/wp-content/plugins/oxygen/component-framework/components/component.class.php on line 2245

Any idea what goes wrong here?

Here’s another way to approach the problem.

Instead of trying to work with MAMP and Duplicator, just use a backup plugin like Updraft Plus to backup your site, and then import it into Local. Here’s how that might go:

  1. With your site running in MAMP, use Updraft Plus to make a backup to Google Drive or some other folder you can access later.
  2. Create a site in Local with the same name
  3. Install Updraft Plus in the Local site and then import the backup you made from the MAMP site as if you were simply restoring a backup.

I do this all the time when switching between Desktop and Laptop for development work. I make a backup from the Desktop and upload it to Google Drive, then import it into the Laptop.

Thanks so much for outlining this solution! It’s the simplest, most logical one I’ve found so far. Honestly, all I’m trying to do is test a restore using UpdraftPlus before making updates to a client site I’ve just taken over and wanted to do so on a Local version.

I think I screwed up somewhere and hope you’re checking this and can help! :slight_smile:

  1. I installed UpdraftPlus on my Local site and in my Settings, I selected the same Dropbox folder as my live site
  2. This Dropbox folder for my live site had the backup in it
  3. In my Local site, I went to Backup/Restore and selected the backup files from my live site folder
  4. It did a restore, but went to my live site URL - I can’t access the wp-admin now on the Local version

Do you know what I did wrong?

Thank you!

@Lil625 When you restored the site from a backup, I assume it replaced your local database with one identical to the production database. That database will be peppered with the domain name and file paths of the live site. That’s probably why your local site is redirecting you to the live site.

When you migrate a database between sites with different domain names you need to find & replace the domain name and system file path wherever they appear in the database, so that they match the domain and file path you chose in Local. This shouldn’t be necessary, but WordPress was poorly designed in this respect.

You can’t just do a string based find & replace, however, since the database includes serialized data too. I recommend using a plugin to perform the find & replace for you. Perhaps Updraft Plus has this feature? I always use WP Migrate DB Pro, which handles serialized data gracefully.

Or, as @clay suggested in the original post, you can drag a zip file containing your site’s database and file system directly into Local and I believe it will change the domain name and files paths to match those you selected in Local.

@jnicol thank you for the quick reply. Makes sense for the most part, although I’m definitely not technically savvy in these areas. :slight_smile: But I think I can make my way through, and appreciate your awesome explanation and additional supplemental/alternate approaches. Thanks again!