This is a notes-to-self kind of article.
Tools of the trade:
Live to Local
(or when starting from a blank site)
- In Pantheon dashboard go inside the live site and switch to
Git
connection mode. - Copy the Git Connection Info. Paste it in a notepad and remove
git clone
at the front and site slug at the end. Ex.:git clone ssh://[email protected]:2222/~/repository.git digital-pro-soliloquy-backstretch
becomesssh://[email protected]:2222/~/repository.git
- Install a local site via DesktopServer. Go to the site’s folder and delete everything except wp-config.php. Rename wp-config.php to wp-config-local.php.
- In SourceTree main window click on +New Repository and then Clone from URL. Paste the trimmed URL from step 2 and press Tab. Click the … button and browse to your local site’s folder. Click Clone button.
- In the local site activate WP Migrate DB Pro and its media addons. Switch to the site in SourceTree and you’ll see Uncommited Changes. Stage all the files and click the Commit button while simultaneously pushing the changes immediately to origin/master i.e., to the live site.
- In WP dashboard of the live site activate WP Migrate DB Pro and its media addons. In WP Migrate DB Pro’s settings turn on Pull permission (Process requests to pull data from this install, copying it elsewhere) and copy the Connection Info.
- In WP dashboard of the local site select Pull and paste the Connection Info. Tick Media Files and Save Migration Profile. Click Pull button. After a few minutes the database and media files should be replicated from live site to the local site.
- At this stage, the local site is in sync with the live site. Changes (file and/or db) can be made at either place and synced to other via SourceTree and WP Migrate DB Pro via Push or Pull as appropriate.
Local to Live
Coming up.