Mamp Mysqldump
Follow these steps to move a local, MAMP development environment to a live, production environment (that has shell and WP-CLI enabled; good web hosts do). We will be using command line to achieve this end. The reason to use command line instead of graphical interfaces, like the myriad of available (S)FTP clients or phpMyAdmin, is that command line lends better performance and reliability. Graphical interfaces will time out, or seemingly take forever to load, if your files are large. There is a higher learning curve to command line—it will feel initially like yawping haphazardly into a void—but the reaped time savings make it well worth practicing. Mendeley web importer mac.
Finalize everything in your local development environment (by adding, removing, editing, and updating plugins, themes, WordPress, content) before proceeding.

First: Back Up
- Local
wp-contentfolder:
open new Terminal window/tabcd [Local WordPress Path](drag WordPress folder from Finder to Terminal to get path)mkdir -p my-wp-backups && tar -czvf wp-content-`date +%F`.tar.gz wp-content -C my-wp-backups - Local
wp-config.phpfile:cp wp-config.php my-wp-backups/wp-config-`date +%F`.php - Local
MySQLdatabase:[Local mysqldump Path] -u [DB_USER] -p --opt [DB_NAME] > wp-database.sql(e.g.,/Applications/MAMP/Library/bin/mysqldump) (see localwp-config.phpfile forDB_USER,DB_NAME, andDB_PASSWORD)
enterDB_PASSWORDtar -czvf wp-database-`date +%F`.sql.tar.gz wp-database.sql -C my-wp-backupsrm wp-database.sql - Production
wp-contentfolder:
open new Terminal window/tabssh username@example.com(e.g.,ssh adamcap.com@adamcap.com)
enter passwordcd [Production WordPress Path](e.g.,cd html)mkdir -p my-wp-backups && tar -czvf wp-content-`date +%F`.tar.gz wp-content -C my-wp-backups - Production
wp-config.phpfile:cp wp-config.php my-wp-backups/wp-config-`date +%F`.php - Production
MySQLdatabase:wp db export wp-database.sqltar -czvf wp-database-`date +%F`.sql.tar.gz wp-database.sql -C my-wp-backupsrm wp-database.sql
$ mysqldump -user=root -password=root -single-transaction drupal current.sql mysqldump: Couldn't execute 'show table status like 'uc order products pair vw': SELECT command denied to user '@'localhost' for column 'nid' in table 'ucorderproducts' (1143) Last lines from mysql.log: 3 Query use `drupal` 3 Query select @@collationdatabase 3 Query SHOW TRIGGERS LIKE 'uc order line. Nov 30, 2020 Question or issue on macOS: I wonder how I can add mysqldump to my MAMP environment. I googled a bit and found only the community MySQL server version. But I do not want to install another MySQL – basically because I want to save my data first, before any experiment. How to solve this problem? One of the changes in Craft 3 is that, by default, it relies on the mysqldump command to create database backups. That is the most reliable way to dump a database without hitting PHP resource limits like could happen in Craft 2 with large databases. The problem for MAMP users, however, is that its mysql and mysqldump executables are not.
Second: Upload wp-content
- Gzip local
wp-contentfolder:
open new Terminal window/tabcd [Local WordPress Path](drag WordPress folder from Finder to Terminal to get path)mv wp-content wp-content-new && tar -czvf wp-content-new.tar.gz wp-content-new && mv wp-content-new wp-content - Upload local
.tar.gzfile to production:
open new Terminal window/tabscp [Local .tar.gz Path] [username@example.com]:[Production WordPress Path](drag.tar.gzfile from Finder to Terminal to get path) (obtain from web host; e.g.,adamcap.com@adamcap.com:/var/www/html/ad/adamcap.com)
enter password - Unzip production
.tar.gzfile:ssh username@example.com(e.g.,ssh adamcap.com@adamcap.com)
enter passwordcd [Production WordPress Path](e.g.,cd html)mkdir wp-content-new && tar -xzvf wp-content-new.tar.gz -C wp-content-new --strip-components 1 - (Switch production
wp-contentfolder:)mv wp-content wp-content-old && mv wp-content-new wp-content - (Revert production
wp-contentfolder:)mv wp-content wp-content-new && mv wp-content-old wp-content
Third: Prepare wp-config.php

- Copy production
wp-config.phpfile:
open new Terminal window/tabssh username@example.com(e.g.,ssh adamcap.com@adamcap.com)
enter passwordcd [Production WordPress Path](e.g.,cd html)cp wp-config.php wp-config-new.php - Edit production
wp-config-new.phpfile:nano wp-config-new.php
UpdateDB_NAME,DB_USER, andDB_PASSWORD(and verify$table_prefix)
control + O (to save), control + X (to exit) - (Switch production
wp-config.phpfile:)mv wp-config.php wp-config-old.php && mv wp-config-new.php wp-config.php - (Revert production
wp-config.phpfile:)mv wp-config.php wp-config-new.php && mv wp-config-old.php wp-config.php
Fourth: Move database

Mamp Mysqldump Change
- Export local
MySQLdatabase:
open new Terminal window/tabcd [Local WordPress Path](drag WordPress folder from Finder to Terminal to get path)[Local mysqldump Path] -u [DB_USER] -p[DB_PASSWORD] --opt [DB_NAME] > wp-database-new.sql(e.g.,/Applications/MAMP/Library/bin/mysqldump) (see localwp-config.phpfile forDB_USER,DB_NAME, andDB_PASSWORD) - Gzip local
.sqlfile:tar -czvf wp-database-new.sql.tar.gz wp-database-new.sql - Upload local
.tar.gzfile:
open new Terminal window/tabscp [Local .tar.gz Path] [username@example.com]:[Production WordPress Path](drag.tar.gzfile from Finder to Terminal to get path) (obtain from web host; e.g.,adamcap.com@adamcap.com:/var/www/html/ad/adamcap.com)
enter password - (Delete unneeded/old local files and folders:)
rm wp-content-new.tar.gzrm wp-database-new.sqlrm wp-database-new.sql.tar.gz - Unzip production
.tar.gzfile:ssh [username@example.com](e.g.,ssh adamcap.com@adamcap.com)
enter passwordcd [Production WordPress Path](e.g.,cd html)tar -xzvf wp-database-new.sql.tar.gz - Switch production
wp-contentfolder:mv wp-content wp-content-old && mv wp-content-new wp-content - Switch production
wp-config.phpfile:mv wp-config.php wp-config-old.php && mv wp-config-new.php wp-config.php
(wp config shuffle-salts) - Create new production database:
wp db drop ; wp db create - Import production
.sqlfile into production database:wp db import wp-database-new.sql - Search/replace production database:
wp search-replace $(wp option get siteurl) [Production Site URL](e.g.,wp search-replace $(wp option get siteurl) https://adamcap.com)
(wp search-replace [Local Hostname] [Production Hostname])
(wp search-replace http://[Production Hostname] https://[Production Hostname]) - (Revert production wp-content folder:)
mv wp-content wp-content-new && mv wp-content-old wp-content - (Revert production wp-config.php file:)
mv wp-config.php wp-config-new.php && mv wp-config-old.php wp-config.php - (Delete unneeded/old production files and folders:)
rm wp-content-new.tar.gzrm wp-database-new.sqlrm wp-database-new.sql.tar.gzrm -rf wp-content-oldrm wp-config-old.php
Mamp Mysqldump Pro
See Also
Mamp Mysqldump Server

Mamp Mysqldump Php
- Move from Live Production Environment to Local macOS Development Sandbox (MAMP) (coming soon)
